Files
sodalive-ios/SodaLive/Sources/Content/Main/V2/Replay/ContentMainTabReplayView.swift

70 lines
2.5 KiB
Swift

//
// ContentMainTabReplayView.swift
// SodaLive
//
// Created by klaus on 2/22/25.
//
import SwiftUI
struct ContentMainTabReplayView: View {
@StateObject var viewModel = ContentMainTabReplayViewModel()
var body: some 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 !viewModel.newReplayContentList.isEmpty {
ContentMainNewContentViewV2(
title: "새로운 라이브 다시듣기",
onClickMore: {
AppState.shared
.setAppStep(step: .newReplayContentAll)
},
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()
}
}
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 2)
}
}
#Preview {
ContentMainTabReplayView()
}