feat: 메인 라이브
- 새로운 UI의 기본 골격 적용
This commit is contained in:
@@ -19,51 +19,39 @@ struct LiveView: View {
|
||||
ZStack {
|
||||
Color.black.ignoresSafeArea()
|
||||
|
||||
GeometryReader { geo in
|
||||
ZStack(alignment: .bottomTrailing) {
|
||||
ZStack(alignment: .bottomTrailing) {
|
||||
VStack(spacing: 0) {
|
||||
HStack(spacing: 24) {
|
||||
Image("img_text_logo")
|
||||
|
||||
Spacer()
|
||||
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
Image("ic_search_white")
|
||||
.onTapGesture {
|
||||
AppState
|
||||
.shared
|
||||
.setAppStep(step: .search)
|
||||
}
|
||||
|
||||
Image("ic_can_circle")
|
||||
.onTapGesture {
|
||||
AppState
|
||||
.shared
|
||||
.setAppStep(step: .canCharge(refresh: {}))
|
||||
}
|
||||
|
||||
Image("ic_message")
|
||||
.onTapGesture {
|
||||
AppState.shared.setAppStep(step: .message)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
.padding(.vertical, 20)
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
LazyVStack(spacing: 40) {
|
||||
if viewModel.recommendLiveItems.count > 0 {
|
||||
SectionRecommendLiveView(items: viewModel.recommendLiveItems)
|
||||
.padding(.top, 13.3)
|
||||
}
|
||||
|
||||
ZStack {
|
||||
Image("img_bg_review_live")
|
||||
.resizable()
|
||||
.frame(height: 53.3)
|
||||
.frame(maxWidth: .infinity)
|
||||
.cornerRadius(2.6)
|
||||
|
||||
HStack(spacing: 2.7) {
|
||||
Image("ic_thumb_play_purple")
|
||||
|
||||
Text("라이브 다시듣기")
|
||||
.font(.custom(Font.bold.rawValue, size: 16.7))
|
||||
.foregroundColor(Color(hex: "672bff"))
|
||||
}
|
||||
.cornerRadius(2.6)
|
||||
}
|
||||
.padding(.horizontal, 13.3)
|
||||
.onTapGesture {
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
AppState.shared.setAppStep(
|
||||
step: .contentAllByTheme(themeId: 7)
|
||||
)
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
}
|
||||
|
||||
if viewModel.recommendChannelItems.count > 0 {
|
||||
SectionRecommendChannelView(
|
||||
items: viewModel.isFollowingList ?
|
||||
viewModel.followedChannelItems :
|
||||
viewModel.recommendChannelItems,
|
||||
isFollowingList: $viewModel.isFollowingList
|
||||
)
|
||||
}
|
||||
|
||||
LazyVStack(spacing: 48) {
|
||||
SectionLiveNowView(
|
||||
items: viewModel.liveNowItems,
|
||||
onClickParticipant: {
|
||||
@@ -85,14 +73,23 @@ struct LiveView: View {
|
||||
}
|
||||
)
|
||||
|
||||
if viewModel.eventBannerItems.count > 0 {
|
||||
SectionEventBannerView(items: viewModel.eventBannerItems)
|
||||
}
|
||||
|
||||
if viewModel.communityPostItems.count > 0 {
|
||||
SectionCommunityPostView(items: viewModel.communityPostItems)
|
||||
}
|
||||
|
||||
if viewModel.recommendLiveItems.count > 0 {
|
||||
SectionRecommendLiveView(items: viewModel.recommendLiveItems)
|
||||
}
|
||||
|
||||
if viewModel.recommendChannelItems.count > 0 {
|
||||
SectionRecommendChannelView(
|
||||
items: viewModel.isFollowingList ?
|
||||
viewModel.followedChannelItems :
|
||||
viewModel.recommendChannelItems,
|
||||
isFollowingList: $viewModel.isFollowingList
|
||||
)
|
||||
}
|
||||
|
||||
SectionLiveReservationView(
|
||||
items: viewModel.liveReservationItems,
|
||||
onClickCancel: { viewModel.getSummary() },
|
||||
@@ -119,8 +116,8 @@ struct LiveView: View {
|
||||
}
|
||||
)
|
||||
}
|
||||
.padding(.vertical, 24)
|
||||
}
|
||||
.frame(width: geo.size.width, height: geo.size.height)
|
||||
.onAppear {
|
||||
viewModel.getSummary()
|
||||
}
|
||||
|
||||
@@ -16,27 +16,7 @@ struct SectionRecommendLiveView: View {
|
||||
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
Text("추천 ")
|
||||
.font(.custom(Font.bold.rawValue, size: 18.3))
|
||||
.foregroundColor(Color(hex: "ff5c49"))
|
||||
|
||||
Text("라이브")
|
||||
.font(.custom(Font.bold.rawValue, size: 18.3))
|
||||
.foregroundColor(.grayee)
|
||||
|
||||
Spacer()
|
||||
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
Image("ic_message")
|
||||
.onTapGesture {
|
||||
AppState.shared.setAppStep(step: .message)
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(width: screenSize().width - 26.7, alignment: .leading)
|
||||
|
||||
VStack(spacing: 0) {
|
||||
TabView(selection: $currentIndex) {
|
||||
ForEach(0..<items.count, id: \.self) { index in
|
||||
let item = items[index]
|
||||
|
||||
Reference in New Issue
Block a user