Files
SodaLive
Preview Content
Resources
Sources
Agora
App
Common
Content
Debug
Dialog
Explorer
Extensions
Follow
Font
IAP
ImagePicker
Keyboard
Live
Main
Message
MyPage
NavigationBar
Onboarding
Report
Settings
Event
Event.swift
EventApi.swift
EventDetailView.swift
EventListView.swift
EventListViewModel.swift
EventRepository.swift
Notice
Notification
SignOut
Terms
SettingsView.swift
SettingsViewModel.swift
Shape
Splash
User
Utils
ContentView.swift
SodaLive.entitlements
SodaLive.xcworkspace
generated
.gitignore
Podfile
Podfile.lock
SodaLive-dev.entitlements
model-SodaLive-dev.json
model-SodaLive.json
sodalive-ios/SodaLive/Sources/Settings/Event/EventDetailView.swift
2023-08-10 22:05:14 +09:00

70 lines
2.3 KiB
Swift

//
// EventDetailView.swift
// SodaLive
//
// Created by klaus on 2023/08/10.
//
import SwiftUI
import Kingfisher
struct EventDetailView: View {
let event: EventItem
var body: some View {
BaseView {
GeometryReader { proxy in
VStack(spacing: 0) {
DetailNavigationBar(title: "이벤트 상세")
ScrollView(.vertical, showsIndicators: false) {
KFImage(URL(string: event.detailImageUrl!))
.resizable()
.scaledToFit()
}
Spacer()
if let link = event.link, link.count > 0, let url = URL(string: link), UIApplication.shared.canOpenURL(url) {
Text("이벤트 참여하기")
.font(.custom(Font.bold.rawValue, size: 18.3))
.foregroundColor(.white)
.padding(.vertical, 16)
.frame(width: screenSize().width - 26.7)
.background(Color(hex: "3e737c"))
.cornerRadius(10)
.padding(13.3)
.background(Color(hex: "222222"))
.cornerRadius(16.7, corners: [.topLeft, .topRight])
.onTapGesture {
UIApplication.shared.open(url)
}
}
if proxy.safeAreaInsets.bottom > 0 {
Rectangle()
.foregroundColor(Color(hex: "222222"))
.frame(width: proxy.size.width, height: 15.3)
}
}
.edgesIgnoringSafeArea(.bottom)
}
}
}
}
struct EventDetailView_Previews: PreviewProvider {
static var previews: some View {
EventDetailView(
event: EventItem(
id: 1,
thumbnailImageUrl: "",
detailImageUrl: "",
popupImageUrl: "",
link: "http://m.naver.com"
)
)
}
}