86 lines
3.4 KiB
Swift
86 lines
3.4 KiB
Swift
//
|
|
// ContentMainReplayAllView.swift
|
|
// SodaLive
|
|
//
|
|
// Created by klaus on 2/22/25.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ContentMainReplayAllView: View {
|
|
|
|
@StateObject var viewModel = ContentNewAllViewModel()
|
|
|
|
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)
|
|
|
|
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) {
|
|
let horizontalPadding: CGFloat = 16
|
|
let gridSpacing: CGFloat = 16
|
|
let itemSize = (screenSize().width - (horizontalPadding * 2) - gridSpacing) / 2
|
|
|
|
LazyVGrid(
|
|
columns: Array(
|
|
repeating: GridItem(
|
|
.flexible(),
|
|
spacing: gridSpacing,
|
|
alignment: .topLeading
|
|
),
|
|
count: 2
|
|
),
|
|
alignment: .leading,
|
|
spacing: gridSpacing
|
|
) {
|
|
ForEach(0..<viewModel.newContentList.count, id: \.self) { index in
|
|
ContentNewAllItemView(width: itemSize, item: viewModel.newContentList[index])
|
|
.onAppear {
|
|
if index == viewModel.newContentList.count - 1 {
|
|
viewModel.getNewContentList()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.padding(.horizontal, 13.3)
|
|
}
|
|
}
|
|
.onAppear {
|
|
viewModel.selectedTheme = "다시듣기"
|
|
}
|
|
}
|
|
.navigationBarHidden(true)
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
ContentMainReplayAllView()
|
|
}
|