feat: 메인 라이브

- 새로운 UI의 기본 골격 적용
This commit is contained in:
Yu Sung
2025-07-22 01:18:21 +09:00
parent 967c83a122
commit 7518ac7957
2 changed files with 47 additions and 70 deletions

View File

@@ -19,51 +19,39 @@ struct LiveView: View {
ZStack {
Color.black.ignoresSafeArea()
GeometryReader { geo in
ZStack(alignment: .bottomTrailing) {
ScrollView(.vertical, showsIndicators: false) {
LazyVStack(spacing: 40) {
if viewModel.recommendLiveItems.count > 0 {
SectionRecommendLiveView(items: viewModel.recommendLiveItems)
.padding(.top, 13.3)
}
VStack(spacing: 0) {
HStack(spacing: 24) {
Image("img_text_logo")
ZStack {
Image("img_bg_review_live")
.resizable()
.frame(height: 53.3)
.frame(maxWidth: .infinity)
.cornerRadius(2.6)
Spacer()
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)
}
Image("ic_search_white")
.onTapGesture {
AppState
.shared
.setAppStep(step: .search)
}
if viewModel.recommendChannelItems.count > 0 {
SectionRecommendChannelView(
items: viewModel.isFollowingList ?
viewModel.followedChannelItems :
viewModel.recommendChannelItems,
isFollowingList: $viewModel.isFollowingList
)
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: 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()
}

View File

@@ -17,26 +17,6 @@ struct SectionRecommendLiveView: View {
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)
TabView(selection: $currentIndex) {
ForEach(0..<items.count, id: \.self) { index in
let item = items[index]