콘텐츠 메인

- 라이브 다시듣기 탭 UI 페이지 생성
This commit is contained in:
Yu Sung
2025-02-22 05:20:55 +09:00
parent 021fbd5294
commit 4df34b7fb6
7 changed files with 242 additions and 6 deletions

View File

@@ -8,8 +8,70 @@
import SwiftUI
struct ContentMainTabReplayView: View {
@StateObject var viewModel = ContentMainTabReplayViewModel()
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
BaseView(isLoading: $viewModel.isLoading) {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 0) {
if !viewModel.bannerList.isEmpty {
ContentMainBannerViewV2(bannerList: viewModel.bannerList)
.padding(.horizontal, 13.3)
}
if !viewModel.newReplayContentList.isEmpty {
ContentMainNewContentViewV2(
title: "새로운 라이브 다시듣기",
onClickMore: {},
themeList: [],
contentList: viewModel.newReplayContentList
) { _ in }
.padding(.top, 30)
}
if !viewModel.creatorList.isEmpty {
ContentByChannelView(
title: "채널별 라이브 다시듣기",
creatorList: viewModel.creatorList,
contentList: viewModel.salesCountRankContentList,
onClickCreator: {
viewModel.getPopularContentByCreator(creatorId: $0)
}
)
.padding(.top, 30)
}
if !viewModel.eventBannerList.isEmpty {
SectionEventBannerView(items: viewModel.eventBannerList)
.padding(.top, 30)
}
if !viewModel.curationList.isEmpty {
ContentMainCurationViewV2(curationList: viewModel.curationList)
.padding(.top, 30)
}
}
.onAppear {
viewModel.fetchData()
}
}
}
.popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
HStack {
Spacer()
Text(viewModel.errorMessage)
.padding(.vertical, 13.3)
.frame(width: screenSize().width - 66.7, alignment: .center)
.font(.custom(Font.medium.rawValue, size: 12))
.background(Color.button)
.foregroundColor(Color.white)
.multilineTextAlignment(.leading)
.cornerRadius(20)
.padding(.bottom, 66.7)
Spacer()
}
}
}
}