콘텐츠 메인 무료 탭

- 크리에이터 소개 전체보기
This commit is contained in:
Yu Sung
2025-02-22 10:23:00 +09:00
parent 8070fa3bef
commit 174416952e
5 changed files with 150 additions and 1 deletions

View File

@@ -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()
}