Files
sodalive-ios/SodaLive/Sources/Content/Series/Main/Home/SeriesMainHomeView.swift

61 lines
2.1 KiB
Swift

//
// SeriesMainHomeView.swift
// SodaLive
//
// Created by klaus on 11/14/25.
//
import SwiftUI
struct SeriesMainHomeView: View {
@StateObject var viewModel = SeriesMainHomeViewModel()
var body: some View {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 48) {
SeriesMainHomeBannerView(bannerList: viewModel.banners)
.padding(.top, 24)
if !viewModel.completedSeriesList.isEmpty {
VStack(alignment: .leading, spacing: 16) {
HStack(spacing: 0) {
Text("완결 시리즈")
.font(.custom(Font.preBold.rawValue, size: 24))
.foregroundColor(.white)
Spacer()
Text("전체보기")
.font(.custom(Font.preRegular.rawValue, size: 14))
.foregroundColor(.init(hex: "78909C"))
}
.padding(.horizontal, 24)
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack(spacing: 16) {
ForEach(0..<viewModel.completedSeriesList.count, id: \.self) {
let item = viewModel.completedSeriesList[$0]
NavigationLink {
SeriesDetailView(seriesId: item.seriesId)
} label: {
SeriesMainItemView(item: item)
}
}
}
.padding(.horizontal, 24)
}
}
}
}
}
.onAppear {
viewModel.fetchHome()
}
}
}
#Preview {
SeriesMainHomeView()
}