Files
sodalive-ios/SodaLive/Sources/V2/CreatorChannel/Donation/Components/CreatorChannelDonationEmptyView.swift

51 lines
1.8 KiB
Swift

import SwiftUI
struct CreatorChannelDonationEmptyView: View {
let showsDonateButton: Bool
let onTapDonate: () -> Void
var body: some View {
VStack(spacing: SodaSpacing.s20) {
Text("아직 후원이 없습니다.\n처음으로 크리에이터를 후원해 보세요!")
.appFont(size: 16, weight: .medium)
.foregroundColor(Color.gray500)
.multilineTextAlignment(.center)
.lineSpacing(SodaSpacing.s4)
if showsDonateButton {
Button(action: onTapDonate) {
HStack(spacing: SodaSpacing.s6) {
Image("ic_new_donation")
.resizable()
.renderingMode(.template)
.foregroundColor(.white)
.scaledToFit()
.frame(width: 20, height: 20)
Text("후원하기")
.appFont(size: 16, weight: .medium)
.foregroundColor(.white)
.lineLimit(1)
}
.padding(.horizontal, SodaSpacing.s20)
.frame(height: 44)
.background(Color.soda400)
.clipShape(Capsule())
}
.buttonStyle(.plain)
}
}
.frame(maxWidth: .infinity)
.padding(.top, 20)
.padding(.bottom, 48)
}
}
struct CreatorChannelDonationEmptyView_Previews: PreviewProvider {
static var previews: some View {
CreatorChannelDonationEmptyView(showsDonateButton: true, onTapDonate: {})
.background(Color.black)
.previewLayout(.sizeThatFits)
}
}