feat(creator): 팬Talk 탭을 추가한다

This commit is contained in:
Yu Sung
2026-07-05 00:44:03 +09:00
parent 7c98af0c7d
commit f5ead536ea
16 changed files with 1250 additions and 28 deletions

View File

@@ -8,6 +8,7 @@ struct CreatorChannelView: View {
@StateObject private var viewModel = CreatorChannelViewModel()
@StateObject private var channelDonationViewModel = ChannelDonationViewModel()
@StateObject private var donationViewModel = CreatorChannelDonationViewModel()
@StateObject private var fanTalkViewModel = CreatorChannelFanTalkViewModel()
@StateObject private var liveViewModel = LiveViewModel()
@StateObject private var mypageViewModel = MyPageViewModel()
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
@@ -121,6 +122,26 @@ struct CreatorChannelView: View {
.padding(.trailing, SodaSpacing.s14)
}
if viewModel.selectedTab == .fanTalk && showFanTalkWrite && !viewModel.isLoading {
VStack {
Spacer()
HStack {
Spacer()
CreatorChannelFloatingIconButton(
imageName: "ic_plus_no_bg",
backgroundColor: Color.soda400,
accessibilityLabel: I18n.CreatorChannelHome.fanTalk,
action: showFanTalkWriteView
)
.padding(.trailing, SodaSpacing.s14)
}
}
.ignoresSafeArea(.container, edges: .bottom)
.padding(.bottom, SodaSpacing.s14)
}
if isShowAuthConfirmView {
authConfirmDialog
}
@@ -220,6 +241,10 @@ struct CreatorChannelView: View {
isOwnCreatorChannel == false && (donationViewModel.donationCount != 0 || donationViewModel.rankings.isEmpty == false)
}
private var showFanTalkWrite: Bool {
isOwnCreatorChannel == false && fanTalkViewModel.fanTalkCount > 0
}
@ViewBuilder
private var selectedTabContent: some View {
if viewModel.selectedTab == .live {
@@ -249,6 +274,13 @@ struct CreatorChannelView: View {
onTapViewAll: showDonationRankingAll,
onTapDonate: showDonationDialog
)
} else if viewModel.selectedTab == .fanTalk {
CreatorChannelFanTalkTabView(
creatorId: creatorId,
isOwnCreatorChannel: isOwnCreatorChannel,
viewModel: fanTalkViewModel,
onTapWrite: showFanTalkWriteView
)
} else if viewModel.selectedTab != .home {
CreatorChannelPlaceholderTabView(title: viewModel.selectedTab.title)
} else if let response = viewModel.response {
@@ -461,6 +493,8 @@ struct CreatorChannelView: View {
channelDonationViewModel.setCreatorId(creatorId, shouldFetch: false)
isShowChannelDonationDialog = true
}
private func showFanTalkWriteView() {}
}
struct CreatorChannelView_Previews: PreviewProvider {