콘텐츠 메인 모닝콜 탭

- 새로운 알람 전체보기
This commit is contained in:
Yu Sung
2025-02-22 08:59:11 +09:00
parent 77626f5fe8
commit 38498c86af
6 changed files with 189 additions and 2 deletions

View File

@@ -0,0 +1,85 @@
//
// ContentMainAlarmAllView.swift
// SodaLive
//
// Created by klaus on 2/22/25.
//
import SwiftUI
struct ContentMainAlarmAllView: View {
@StateObject var viewModel = ContentMainAlarmAllViewModel()
let columns = [
GridItem(.flexible(), alignment: .top),
GridItem(.flexible(), alignment: .top),
GridItem(.flexible(), alignment: .top)
]
var body: some View {
NavigationView {
BaseView(isLoading: $viewModel.isLoading) {
VStack(alignment: .leading, spacing: 13.3) {
DetailNavigationBar(title: "새로운 알람")
Text("※ 최근 2주간 등록된 새로운 알람 입니다.")
.font(.custom(Font.medium.rawValue, size: 14.7))
.foregroundColor(.graybb)
.padding(.horizontal, 13.3)
.padding(.vertical, 8)
.frame(width: screenSize().width, alignment: .leading)
.background(Color.gray22)
ContentMainNewContentThemeView(
themes: viewModel.themeList,
selectTheme: {
viewModel.selectedTheme = $0
},
selectedTheme: $viewModel.selectedTheme
)
.padding(.horizontal, 20)
HStack(spacing: 0) {
Text("전체")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "e2e2e2"))
Text("\(viewModel.totalCount)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "ff5c49"))
.padding(.leading, 8)
Text("")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "e2e2e2"))
.padding(.leading, 2)
}
.padding(.horizontal, 13.3)
ScrollView(.vertical, showsIndicators: false) {
LazyVGrid(columns: columns, spacing: 32) {
ForEach(0..<viewModel.newContentList.count, id: \.self) { index in
ContentNewAllItemView(item: viewModel.newContentList[index])
.onAppear {
if index == viewModel.newContentList.count - 1 {
viewModel.getContentMainAlarmAll()
}
}
}
}
.padding(.horizontal, 13.3)
}
}
.onAppear {
viewModel.getContentMainAlarmAll()
}
}
.navigationBarHidden(true)
}
}
}
#Preview {
ContentMainAlarmAllView()
}