feat(creator): 커뮤니티 아이템 표시를 통일한다
This commit is contained in:
@@ -321,13 +321,16 @@ struct CreatorChannelView: View {
|
||||
} else if let response = viewModel.response {
|
||||
CreatorChannelHomeView(
|
||||
response: response,
|
||||
isOwnCreatorChannel: isOwnCreatorChannel,
|
||||
onSelectTab: selectTab,
|
||||
onTapLive: showLiveDetail,
|
||||
onTapContent: showContentDetail,
|
||||
onTapDonate: showDonationDialog,
|
||||
onTapSchedule: handleScheduleTap,
|
||||
onTapSeries: showSeriesDetail,
|
||||
onTapCommunityLike: viewModel.likeCommunityPost
|
||||
onTapCommunityLike: viewModel.likeCommunityPost,
|
||||
onTapCommunityMore: communityViewModel.openReportMenu,
|
||||
onTapCommunityDetail: showCommunityPostDetail
|
||||
)
|
||||
} else {
|
||||
EmptyView()
|
||||
@@ -474,17 +477,22 @@ struct CreatorChannelView: View {
|
||||
)
|
||||
}
|
||||
|
||||
private func showCommunityPostDetail(_ post: CreatorChannelCommunityPostItem) {
|
||||
private func showCommunityPostDetail(_ postId: Int) {
|
||||
AppState.shared.setAppStep(
|
||||
step: .creatorChannelCommunityPostDetail(
|
||||
postId: post.postId,
|
||||
postId: postId,
|
||||
onCommunityRefresh: {
|
||||
communityViewModel.fetchFirstPage(creatorId: creatorId)
|
||||
refreshCommunityFeeds()
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private func refreshCommunityFeeds() {
|
||||
viewModel.fetchHome(creatorId: creatorId)
|
||||
communityViewModel.fetchFirstPage(creatorId: creatorId)
|
||||
}
|
||||
|
||||
private func showAudioContentUpload() {
|
||||
isCreatorActionMenuPresented = false
|
||||
AppState.shared.setAppStep(
|
||||
@@ -595,7 +603,7 @@ struct CreatorChannelView: View {
|
||||
|
||||
@ViewBuilder
|
||||
private func communityOverlay(proxy: GeometryProxy) -> some View {
|
||||
if viewModel.selectedTab == .community {
|
||||
if viewModel.selectedTab == .home || viewModel.selectedTab == .community {
|
||||
if communityViewModel.isShowReportMenu {
|
||||
VStack(spacing: 0) {
|
||||
CreatorCommunityMenuView(
|
||||
@@ -603,7 +611,7 @@ struct CreatorChannelView: View {
|
||||
isShowCreatorMenu: isOwnCreatorChannel,
|
||||
isFixed: communityViewModel.selectedPostIsPinned,
|
||||
fixedAction: {
|
||||
communityViewModel.updateCommunityPostFixed(creatorId: creatorId)
|
||||
communityViewModel.updateCommunityPostFixed(onSuccess: refreshCommunityFeeds)
|
||||
},
|
||||
modifyAction: showCommunityModify,
|
||||
deleteAction: {
|
||||
@@ -638,7 +646,7 @@ struct CreatorChannelView: View {
|
||||
button1: SodaV2ActionModalButton(
|
||||
label: I18n.Common.delete,
|
||||
action: {
|
||||
communityViewModel.deleteCommunityPost(creatorId: creatorId)
|
||||
communityViewModel.deleteCommunityPost(onSuccess: refreshCommunityFeeds)
|
||||
communityViewModel.isShowDeleteConfirm = false
|
||||
}
|
||||
),
|
||||
@@ -650,16 +658,6 @@ struct CreatorChannelView: View {
|
||||
)
|
||||
}
|
||||
|
||||
if communityViewModel.isShowPostPurchaseView {
|
||||
CommunityPostPurchaseDialog(
|
||||
isShowing: $communityViewModel.isShowPostPurchaseView,
|
||||
can: communityViewModel.selectedPostPrice,
|
||||
confirmAction: {
|
||||
communityViewModel.purchaseCommunityPost(creatorId: creatorId)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
if communityViewModel.isLoading {
|
||||
LoadingView()
|
||||
}
|
||||
@@ -674,7 +672,7 @@ struct CreatorChannelView: View {
|
||||
step: .creatorCommunityModify(
|
||||
postId: postId,
|
||||
onSuccess: {
|
||||
communityViewModel.fetchFirstPage(creatorId: creatorId)
|
||||
refreshCommunityFeeds()
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user