feat(creator): 팬Talk 쓰기 화면을 연결한다
This commit is contained in:
@@ -291,7 +291,8 @@ struct CreatorChannelView: View {
|
||||
creatorId: creatorId,
|
||||
isOwnCreatorChannel: isOwnCreatorChannel,
|
||||
viewModel: fanTalkViewModel,
|
||||
onTapWrite: showFanTalkWriteView
|
||||
onTapWrite: showFanTalkWriteView,
|
||||
onTapEdit: showFanTalkModifyView
|
||||
)
|
||||
} else if viewModel.selectedTab == .community {
|
||||
CreatorChannelCommunityTabView(
|
||||
@@ -599,7 +600,35 @@ struct CreatorChannelView: View {
|
||||
communityViewModel.selectedPostId = 0
|
||||
}
|
||||
|
||||
private func showFanTalkWriteView() {}
|
||||
private func showFanTalkWriteView() {
|
||||
AppState.shared.setAppStep(
|
||||
step: .creatorChannelFanTalkWrite(
|
||||
creatorId: creatorId,
|
||||
mode: .write,
|
||||
fanTalkId: nil,
|
||||
initialContent: "",
|
||||
onSuccess: {
|
||||
viewModel.fetchHome(creatorId: creatorId)
|
||||
fanTalkViewModel.fetchFirstPage(creatorId: creatorId)
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private func showFanTalkModifyView(_ fanTalk: CreatorChannelFanTalkItemResponse) {
|
||||
AppState.shared.setAppStep(
|
||||
step: .creatorChannelFanTalkWrite(
|
||||
creatorId: creatorId,
|
||||
mode: .modify(fanTalkId: fanTalk.fanTalkId, initialContent: fanTalk.content),
|
||||
fanTalkId: fanTalk.fanTalkId,
|
||||
initialContent: fanTalk.content,
|
||||
onSuccess: {
|
||||
viewModel.fetchHome(creatorId: creatorId)
|
||||
fanTalkViewModel.fetchFirstPage(creatorId: creatorId)
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
struct CreatorChannelView_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user