새로운 콘텐츠 전체보기 페이지 추가
This commit is contained in:
81
SodaLive/Sources/Content/All/ContentNewAllView.swift
Normal file
81
SodaLive/Sources/Content/All/ContentNewAllView.swift
Normal file
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// ContentNewAllView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/09/27.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentNewAllView: View {
|
||||
|
||||
@StateObject var viewModel = ContentNewAllViewModel()
|
||||
|
||||
let columns = [
|
||||
GridItem(.flexible()),
|
||||
GridItem(.flexible())
|
||||
]
|
||||
|
||||
var body: some View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(spacing: 0) {
|
||||
DetailNavigationBar(title: "새로운 콘텐츠")
|
||||
|
||||
Text("※ 최근 2주간 등록된 새로운 콘텐츠 입니다.")
|
||||
.font(.custom(Font.medium.rawValue, size: 14.7))
|
||||
.foregroundColor(Color(hex: "bbbbbb"))
|
||||
.padding(.horizontal, 13.3)
|
||||
.padding(.vertical, 8)
|
||||
.frame(width: screenSize().width, alignment: .leading)
|
||||
.background(Color(hex: "222222"))
|
||||
.padding(.top, 13.3)
|
||||
|
||||
ContentMainNewContentThemeView(
|
||||
themes: viewModel.themeList,
|
||||
selectTheme: {
|
||||
viewModel.selectedTheme = $0
|
||||
},
|
||||
selectedTheme: $viewModel.selectedTheme
|
||||
).padding(.top, 13.3)
|
||||
|
||||
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)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.padding(.vertical, 13.3)
|
||||
.padding(.horizontal, 20)
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
LazyVGrid(columns: columns, spacing: 13.3) {
|
||||
ForEach(0..<viewModel.newContentList.count, id: \.self) {
|
||||
ContentNewAllItemView(item: viewModel.newContentList[$0])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.getThemeList()
|
||||
viewModel.getNewContentList()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct ContentNewAllView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentNewAllView()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user