콘텐츠 메인 무료 탭
- 크리에이터 소개 전체보기
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// ContentMainIntroduceCreatorAllView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2/22/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentMainIntroduceCreatorAllView: View {
|
||||
|
||||
@StateObject var viewModel = ContentMainIntroduceCreatorAllViewModel()
|
||||
|
||||
let columns = [
|
||||
GridItem(.flexible()),
|
||||
GridItem(.flexible()),
|
||||
GridItem(.flexible())
|
||||
]
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(spacing: 13.3) {
|
||||
DetailNavigationBar(title: "크리에이터 소개")
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
LazyVGrid(columns: columns, spacing: 13.3) {
|
||||
ForEach(0..<viewModel.introduceCreatorList.count, id: \.self) { index in
|
||||
let item = viewModel.introduceCreatorList[index]
|
||||
ContentNewAllItemView(item: item)
|
||||
.onAppear {
|
||||
if index == viewModel.introduceCreatorList.count - 1 {
|
||||
viewModel.getIntroduceCreatorList()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 13.3)
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.getIntroduceCreatorList()
|
||||
}
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
.popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
|
||||
HStack {
|
||||
Spacer()
|
||||
Text(viewModel.errorMessage)
|
||||
.padding(.vertical, 13.3)
|
||||
.frame(width: screenSize().width - 66.7, alignment: .center)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.background(Color.button)
|
||||
.foregroundColor(Color.white)
|
||||
.multilineTextAlignment(.leading)
|
||||
.cornerRadius(20)
|
||||
.padding(.bottom, 66.7)
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ContentMainIntroduceCreatorAllView()
|
||||
}
|
||||
Reference in New Issue
Block a user