feat(creator-channel): 홈 빈 상태 동작을 보강한다
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user