feat(home): 인기 커뮤니티 섹션을 연결한다
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user