fix(creator): 후원 카드 너비를 보정한다

This commit is contained in:
Yu Sung
2026-07-20 18:09:51 +09:00
parent 43e32f1867
commit 9a0e75a391
3 changed files with 48 additions and 1 deletions

View File

@@ -1,10 +1,17 @@
import SwiftUI
struct CreatorChannelDonationSection: View {
private static let baseDeviceWidth: CGFloat = 402
private static let maxCardWidth: CGFloat = 374
let channelDonations: [CreatorChannelDonationResponse]
let onSelectTab: (CreatorChannelTab) -> Void
let onTapDonate: () -> Void
private var cardWidth: CGFloat {
Self.maxCardWidth * min(UIScreen.main.bounds.width / Self.baseDeviceWidth, 1)
}
init(
channelDonations: [CreatorChannelDonationResponse],
onSelectTab: @escaping (CreatorChannelTab) -> Void,
@@ -29,7 +36,7 @@ struct CreatorChannelDonationSection: View {
HStack(alignment: .top, spacing: SodaSpacing.s4) {
ForEach(channelDonations.indices, id: \.self) { index in
CreatorChannelDonationCard(donation: channelDonations[index])
.frame(width: 374)
.frame(width: cardWidth)
}
}
.padding(.leading, SodaSpacing.s14)