|
|
|
|
@ -10,21 +10,21 @@ import TipKit |
|
|
|
|
|
|
|
|
|
struct SubscriptionInfoView: View { |
|
|
|
|
|
|
|
|
|
var payment: Tournament.TournamentPayment? = .free |
|
|
|
|
|
|
|
|
|
init() { |
|
|
|
|
self.payment = Guard.main.paymentForNewTournament() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@State var payment: Tournament.TournamentPayment? = .free |
|
|
|
|
|
|
|
|
|
var body: some View { |
|
|
|
|
|
|
|
|
|
switch self.payment { |
|
|
|
|
case .free: |
|
|
|
|
TipView(FreeTournamentTip()).tipStyle(tint: nil, background: .blue.opacity(0.2)) |
|
|
|
|
case nil: |
|
|
|
|
TipView(NoPaymentTip()).tipStyle(tint: nil, background: .logoRed) |
|
|
|
|
default: |
|
|
|
|
EmptyView() |
|
|
|
|
Group { |
|
|
|
|
switch self.payment { |
|
|
|
|
case .free: |
|
|
|
|
TipView(FreeTournamentTip()).tipStyle(tint: nil, background: .blue.opacity(0.2)) |
|
|
|
|
case nil: |
|
|
|
|
TipView(NoPaymentTip()).tipStyle(tint: nil, background: .logoRed) |
|
|
|
|
default: |
|
|
|
|
EmptyView() |
|
|
|
|
} |
|
|
|
|
}.onAppear { |
|
|
|
|
self.payment = Guard.main.paymentForNewTournament() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|