feat(home): 인기 커뮤니티 섹션을 연결한다

This commit is contained in:
Yu Sung
2026-06-30 01:44:20 +09:00
parent 20601f40cf
commit 339ca78793
16 changed files with 578 additions and 110 deletions

View File

@@ -10,6 +10,7 @@ struct MainHomeRecommendationView: View {
let onTapFollowAll: (@escaping () -> Void) -> Void
@StateObject private var viewModel = MainHomeRecommendationViewModel()
@StateObject private var communityMediaPlayer = CreatorCommunityMediaPlayerManager.shared
var body: some View {
ZStack {
@@ -75,6 +76,17 @@ struct MainHomeRecommendationView: View {
}
}
)
MainHomePopularCommunitySection(
items: viewModel.recommendations?.popularCommunityPosts ?? [],
onTapCommunity: onTapCommunity,
onTapLike: { postId in
viewModel.likeCommunityPost(postId: postId)
},
onTapPurchase: { item in
viewModel.openCommunityPostPurchase(postId: item.postId, price: item.price)
}
)
}
.padding(.vertical, SodaSpacing.s20)
}
@@ -90,6 +102,24 @@ struct MainHomeRecommendationView: View {
message: viewModel.errorMessage,
autohideIn: 2
)
.sodaToast(
isPresented: $communityMediaPlayer.isShowPopup,
message: communityMediaPlayer.errorMessage,
autohideIn: 2
)
.overlay {
if viewModel.isShowCommunityPostPurchaseDialog {
CommunityPostPurchaseDialog(
isShowing: $viewModel.isShowCommunityPostPurchaseDialog,
can: viewModel.purchasingCommunityPostPrice,
confirmAction: viewModel.purchaseCommunityPost
)
}
if communityMediaPlayer.isLoading {
LoadingView()
}
}
}
}