콘텐츠 메인

- 무료 탭 UI 페이지 생성
This commit is contained in:
Yu Sung
2025-02-22 05:50:26 +09:00
parent 4df34b7fb6
commit e6621c6606
5 changed files with 279 additions and 5 deletions

View File

@@ -15,7 +15,76 @@ struct ContentMainTabFreeView: View {
BaseView(isLoading: $viewModel.isLoading) {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 0) {
if !viewModel.bannerList.isEmpty {
ContentMainBannerViewV2(bannerList: viewModel.bannerList)
.padding(.horizontal, 13.3)
}
if let introduceCreator = viewModel.introduceCreator {
ContentMainNewContentViewV2(
title: introduceCreator.title,
onClickMore: {},
themeList: [],
contentList: introduceCreator.items
) { _ in }
.padding(.top, 30)
}
if !viewModel.recommendSeriesList.isEmpty {
ContentMainNewOrRecommendSeriesView(
title: "추천 무료 시리즈",
recommendSeriesList: viewModel.recommendSeriesList
)
.padding(.top, 30)
}
if !viewModel.themeList.isEmpty {
ContentMainNewContentViewV2(
title: "새로운 무료 콘텐츠",
onClickMore: {},
themeList: viewModel.themeList,
contentList: viewModel.newFreeContentList
) {
viewModel.getNewContentOfTheme(theme: $0)
}
.padding(.top, 30)
}
if !viewModel.creatorList.isEmpty {
ContentByChannelView(
title: "채널별 추천 무료 콘텐츠",
creatorList: viewModel.creatorList,
contentList: viewModel.playCountRankContentList,
onClickCreator: {
viewModel.getPopularContentByCreator(creatorId: $0)
}
)
.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()
}
}
}