feat(series-all-home): 시리즈 전체보기 홈 탭 완결 시리즈 UI 추가
This commit is contained in:
@@ -16,6 +16,37 @@ struct SeriesMainHomeView: View {
|
||||
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 {
|
||||
|
||||
@@ -17,6 +17,7 @@ final class SeriesMainHomeViewModel: ObservableObject {
|
||||
@Published var isShowPopup = false
|
||||
|
||||
@Published var banners: [SeriesBannerResponse] = []
|
||||
@Published var completedSeriesList: [SeriesListItem] = []
|
||||
|
||||
func fetchHome() {
|
||||
isLoading = true
|
||||
@@ -38,6 +39,7 @@ final class SeriesMainHomeViewModel: ObservableObject {
|
||||
|
||||
if let data = decoded.data, decoded.success {
|
||||
self.banners = data.banners
|
||||
self.completedSeriesList = data.completedSeriesList
|
||||
} else {
|
||||
if let message = decoded.message {
|
||||
self.errorMessage = message
|
||||
|
||||
Reference in New Issue
Block a user