|
|
|
|
@ -12,6 +12,7 @@ import PadelClubData |
|
|
|
|
struct AccountView: View { |
|
|
|
|
|
|
|
|
|
@Environment(\.dismiss) private var dismiss |
|
|
|
|
@EnvironmentObject var dataStore: DataStore |
|
|
|
|
|
|
|
|
|
var user: CustomUser |
|
|
|
|
var handler: () -> () |
|
|
|
|
@ -23,6 +24,61 @@ struct AccountView: View { |
|
|
|
|
PurchaseView(purchaseRow: PurchaseRow(id: purchase.id, name: purchase.productId, item: item)) |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
let onlineRegPaymentMode = dataStore.user.registrationPaymentMode |
|
|
|
|
Section { |
|
|
|
|
LabeledContent { |
|
|
|
|
switch onlineRegPaymentMode { |
|
|
|
|
case .corporate: |
|
|
|
|
Text("Activé") |
|
|
|
|
.bold() |
|
|
|
|
.foregroundStyle(.green) |
|
|
|
|
case .disabled: |
|
|
|
|
Text("Désactivé") |
|
|
|
|
.bold() |
|
|
|
|
case .noFee: |
|
|
|
|
Text("Activé") |
|
|
|
|
.bold() |
|
|
|
|
.foregroundStyle(.green) |
|
|
|
|
case .stripe: |
|
|
|
|
Text("Activé") |
|
|
|
|
.bold() |
|
|
|
|
.foregroundStyle(.green) |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Option 'Paiement en ligne'") |
|
|
|
|
if onlineRegPaymentMode == .corporate { |
|
|
|
|
Text("Mode Padel Club") |
|
|
|
|
.foregroundStyle(.secondary) |
|
|
|
|
} else if onlineRegPaymentMode == .noFee { |
|
|
|
|
Text("Commission Stripe") |
|
|
|
|
.foregroundStyle(.secondary) |
|
|
|
|
} else if onlineRegPaymentMode == .stripe { |
|
|
|
|
Text("Commission Stripe et Padel Club") |
|
|
|
|
.foregroundStyle(.secondary) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} footer: { |
|
|
|
|
if onlineRegPaymentMode == .disabled { |
|
|
|
|
FooterButtonView("Contactez nous pour activer cette option.") { |
|
|
|
|
let emailTo: String = "support@padelclub.app" |
|
|
|
|
let subject: String = "Activer l'option de paiment en ligne : \(dataStore.user.email)" |
|
|
|
|
if let url = URL(string: "mailto:\(emailTo)?subject=\(subject)"), UIApplication.shared.canOpenURL(url) { |
|
|
|
|
UIApplication.shared.open(url, options: [:], completionHandler: nil) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.font(.callout) |
|
|
|
|
.multilineTextAlignment(.leading) |
|
|
|
|
} else { |
|
|
|
|
Text("Permet de proposer le paiement de vos tournois en ligne.") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
|
Text("Vous souhaitez partager la supervision d'un tournoi à un autre compte ? Vous avez plusieurs juge-arbitres dans votre club ?") |
|
|
|
|
SupportButtonView(supportButtonType: .sharingRequest) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Section { |
|
|
|
|
NavigationLink("Changer de mot de passe") { |
|
|
|
|
ChangePasswordView() |
|
|
|
|
|