feat(home): 홈 탭 shell을 연결한다

This commit is contained in:
Yu Sung
2026-06-27 00:09:04 +09:00
parent 5757705b12
commit 394e7ebc34
8 changed files with 354 additions and 13 deletions

View File

@@ -0,0 +1,45 @@
import SwiftUI
struct MainHomeRecommendationView: View {
let onTapLive: (Int) -> Void
let onTapCreator: (Int) -> Void
let onTapContent: (Int) -> Void
let onTapCharacter: (Int) -> Void
let onTapCommunity: (Int) -> Void
@StateObject private var viewModel = MainHomeRecommendationViewModel()
var body: some View {
ZStack {
Color.black
.ignoresSafeArea()
if viewModel.isLoading && viewModel.recommendations == nil {
ProgressView()
.progressViewStyle(CircularProgressViewStyle(tint: .white))
}
}
.onAppear {
if viewModel.recommendations == nil {
viewModel.fetchRecommendations()
}
}
.sodaToast(
isPresented: $viewModel.isShowPopup,
message: viewModel.errorMessage,
autohideIn: 2
)
}
}
struct MainHomeRecommendationView_Previews: PreviewProvider {
static var previews: some View {
MainHomeRecommendationView(
onTapLive: { _ in },
onTapCreator: { _ in },
onTapContent: { _ in },
onTapCharacter: { _ in },
onTapCommunity: { _ in }
)
}
}