60 lines
2.0 KiB
Swift
60 lines
2.0 KiB
Swift
//
|
|
// ContentMainTabAlarmView.swift
|
|
// SodaLive
|
|
//
|
|
// Created by klaus on 2/22/25.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ContentMainTabAlarmView: View {
|
|
|
|
@StateObject var viewModel = ContentMainTabAlarmViewModel()
|
|
|
|
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.alarmThemeList.isEmpty {
|
|
ContentMainNewContentViewV2(
|
|
title: "새로운 알람",
|
|
onClickMore: {
|
|
AppState.shared
|
|
.setAppStep(step: .newAlarmContentAll)
|
|
},
|
|
themeList: viewModel.alarmThemeList,
|
|
contentList: viewModel.newAlarmContentList
|
|
) {
|
|
viewModel.getContentMainAlarm(theme: $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 {
|
|
ContentMainTabAlarmView()
|
|
}
|