Laurent 6 months ago
parent 937edb440b
commit 4663f32102
  1. 2
      PadelClub/Views/Planning/PlanningSettingsView.swift
  2. 24
      PadelClub/Views/Tournament/Subscription/PaymentStatusView.swift

@ -48,7 +48,7 @@ struct PlanningSettingsView: View {
var body: some View { var body: some View {
List { List {
if tournament.payment == nil { if tournament.payment == nil {
ImageInfoView() PaymentStatusView()
// SubscriptionInfoView() // SubscriptionInfoView()
} }

@ -15,15 +15,11 @@ struct ImageInfoView: View {
@State var textColor: Color = .black @State var textColor: Color = .black
@State var backgroundColor: Color = .blue.opacity(0.2) @State var backgroundColor: Color = .blue.opacity(0.2)
@State var textOnTap: String? = nil
@State var showPopover: Bool = false @State var showPopover: Bool = false
var tip: (any Tip)? = nil var tip: (any Tip)? = nil
var body: some View { var body: some View {
Group {
if #available(iOS 18.4, *) {
HStack { HStack {
Image(systemName: self.systemImage) Image(systemName: self.systemImage)
.font(.title) .font(.title)
@ -32,21 +28,6 @@ struct ImageInfoView: View {
.foregroundStyle(self.textColor) .foregroundStyle(self.textColor)
.fontWeight(.semibold) .fontWeight(.semibold)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
}.popoverTip(self.tip)
} else {
HStack {
Image(systemName: self.systemImage)
.font(.title)
.foregroundStyle(.white)
Text(self.text)
.fontWeight(.semibold)
.frame(maxWidth: .infinity)
}.onTapGesture {
if self.tip != nil {
self.showPopover = true
}
}
}
} }
.alert("Message", isPresented: self.$showPopover, actions: { }, message: { .alert("Message", isPresented: self.$showPopover, actions: { }, message: {
if let tip { if let tip {
@ -58,8 +39,7 @@ struct ImageInfoView: View {
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.padding() .padding()
.background(self.backgroundColor) .background(self.backgroundColor)
.listRowInsets(EdgeInsets())
.listRowInsets(EdgeInsets()) // Remove default insets
} }
} }
@ -76,10 +56,8 @@ struct PaymentStatusView: View {
let end = remaining > 1 ? "s" : "" let end = remaining > 1 ? "s" : ""
let text = "Tournoi offert (\(remaining) restant\(end))" let text = "Tournoi offert (\(remaining) restant\(end))"
ImageInfoView(systemImage: "gift.fill", text: text, tip: FreeTournamentTip()) ImageInfoView(systemImage: "gift.fill", text: text, tip: FreeTournamentTip())
// TipView(FreeTournamentTip()).tipStyle(tint: nil, background: .blue.opacity(0.2))
case nil: case nil:
ImageInfoView(systemImage: "exclamationmark.bubble.fill", text: "Veuillez souscrire à une offre pour convoquer ou entrer un résultat", textColor: .white, backgroundColor: .logoRed, tip: NoPaymentTip()) ImageInfoView(systemImage: "exclamationmark.bubble.fill", text: "Veuillez souscrire à une offre pour convoquer ou entrer un résultat", textColor: .white, backgroundColor: .logoRed, tip: NoPaymentTip())
// TipView(NoPaymentTip()).tipStyle(tint: nil, background: .logoRed)
default: default:
EmptyView() EmptyView()
} }

Loading…
Cancel
Save