fix(creator): 후원 카드 너비를 보정한다
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user