feat(creator-channel): 홈 빈 상태 동작을 보강한다

This commit is contained in:
Yu Sung
2026-08-14 18:41:04 +09:00
parent 2203fc9089
commit 6db26c55a8
7 changed files with 183 additions and 16 deletions

View File

@@ -382,6 +382,7 @@ struct CreatorChannelView: View {
onTapLive: showLiveDetail,
onTapContent: showContentDetail,
onTapDonate: showDonationDialog,
onTapFanTalkWrite: showFanTalkWriteView,
onTapSchedule: handleScheduleTap,
onTapSeries: showSeriesDetail,
onTapCommunityLike: viewModel.likeCommunityPost,

View File

@@ -78,10 +78,15 @@ private struct CreatorChannelDonationEmptyCard: View {
var body: some View {
VStack(alignment: .leading, spacing: 0) {
Text("처음으로 크리에이터를\n후원해 보세요!")
Text(I18n.CreatorChannelHome.donationEmptyMessage)
.appFont(size: 24, weight: .bold)
.foregroundColor(.white)
.lineSpacing(0)
.lineLimit(2)
.frame(
maxWidth: LanguageHeaderProvider.current == "ja" ? 210 : .infinity,
alignment: .leading
)
.padding(.top, SodaSpacing.s20)
.padding(.leading, SodaSpacing.s20)

View File

@@ -2,23 +2,78 @@ import SwiftUI
struct CreatorChannelFanTalkSection: View {
let fanTalk: CreatorChannelFanTalkSummaryResponse
let showsWriteButton: Bool
let onSelectTab: (CreatorChannelTab) -> Void
let onTapWrite: () -> Void
var body: some View {
if let latestFanTalk = fanTalk.latestFanTalk {
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
SectionTitle(title: I18n.CreatorChannelHome.fanTalk) {
onSelectTab(.fanTalk)
}
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
SectionTitle(title: I18n.CreatorChannelHome.fanTalk) {
onSelectTab(.fanTalk)
}
if let latestFanTalk = fanTalk.latestFanTalk {
CreatorChannelFanTalkCard(
totalCount: fanTalk.totalCount,
latestFanTalk: latestFanTalk
)
.padding(.horizontal, SodaSpacing.s14)
} else {
CreatorChannelFanTalkEmptyCard(
showsWriteButton: showsWriteButton,
onTapWrite: onTapWrite
)
.padding(.horizontal, SodaSpacing.s14)
}
.padding(.top, SodaSpacing.s20)
}
.padding(.top, SodaSpacing.s20)
}
}
private struct CreatorChannelFanTalkEmptyCard: View {
let showsWriteButton: Bool
let onTapWrite: () -> Void
var body: some View {
VStack(alignment: .leading, spacing: 0) {
Text(I18n.CreatorChannelHome.fanTalkEmptyMessage)
.appFont(size: 24, weight: .bold)
.foregroundColor(.white)
.lineSpacing(0)
.padding(.top, SodaSpacing.s20)
.padding(.leading, SodaSpacing.s20)
Spacer(minLength: 0)
if showsWriteButton {
Button(action: onTapWrite) {
HStack(spacing: SodaSpacing.s6) {
Image("ic_plus_no_bg")
.resizable()
.renderingMode(.template)
.foregroundColor(.black)
.scaledToFit()
.frame(width: 20, height: 20)
Text(I18n.CreatorChannelFanTalk.writeAction)
.appFont(size: 16, weight: .medium)
.foregroundColor(.black)
.lineLimit(1)
}
.frame(maxWidth: .infinity)
.padding(SodaSpacing.s12)
.background(Color.white)
.clipShape(Capsule())
}
.buttonStyle(.plain)
.padding(.horizontal, SodaSpacing.s20)
.padding(.bottom, SodaSpacing.s20)
}
}
.frame(height: 196)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaSpacing.s14, style: .continuous))
}
}
@@ -77,7 +132,9 @@ struct CreatorChannelFanTalkSection_Previews: PreviewProvider {
createdAtUtc: "2026-07-03T03:44:00Z"
)
),
onSelectTab: { _ in }
showsWriteButton: true,
onSelectTab: { _ in },
onTapWrite: {}
)
.background(Color.black)
.previewLayout(.sizeThatFits)

View File

@@ -7,6 +7,7 @@ struct CreatorChannelHomeView: View {
let onTapLive: (Int) -> Void
let onTapContent: (Int) -> Void
let onTapDonate: () -> Void
let onTapFanTalkWrite: () -> Void
let onTapSchedule: (CreatorActivityType, Int) -> Void
let onTapSeries: (Int) -> Void
let onTapCommunityLike: (Int) -> Void
@@ -20,6 +21,7 @@ struct CreatorChannelHomeView: View {
onTapLive: @escaping (Int) -> Void = { _ in },
onTapContent: @escaping (Int) -> Void = { _ in },
onTapDonate: @escaping () -> Void = {},
onTapFanTalkWrite: @escaping () -> Void = {},
onTapSchedule: @escaping (CreatorActivityType, Int) -> Void = { _, _ in },
onTapSeries: @escaping (Int) -> Void = { _ in },
onTapCommunityLike: @escaping (Int) -> Void = { _ in },
@@ -32,6 +34,7 @@ struct CreatorChannelHomeView: View {
self.onTapLive = onTapLive
self.onTapContent = onTapContent
self.onTapDonate = onTapDonate
self.onTapFanTalkWrite = onTapFanTalkWrite
self.onTapSchedule = onTapSchedule
self.onTapSeries = onTapSeries
self.onTapCommunityLike = onTapCommunityLike
@@ -90,7 +93,9 @@ struct CreatorChannelHomeView: View {
CreatorChannelFanTalkSection(
fanTalk: response.fanTalk,
onSelectTab: onSelectTab
showsWriteButton: isOwnCreatorChannel == false,
onSelectTab: onSelectTab,
onTapWrite: onTapFanTalkWrite
)
CreatorChannelIntroduceSection(introduce: response.introduce)