|
|
|
@ -56,25 +56,24 @@ struct UmpireView: View { |
|
|
|
|
|
|
|
|
|
|
|
NavigationLink { |
|
|
|
NavigationLink { |
|
|
|
MainUserView() |
|
|
|
MainUserView() |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
LabeledContent { |
|
|
|
|
|
|
|
if Store.main.userName() != nil { |
|
|
|
|
|
|
|
Text(dataStore.user.username) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Image(systemName: "xmark.circle.fill") |
|
|
|
|
|
|
|
.foregroundStyle(.logoRed) |
|
|
|
|
|
|
|
} |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Label("Mon compte", systemImage: "person.fill") |
|
|
|
Label("Mon compte", systemImage: "person.fill") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let currentPlayerData = dataStore.user.currentPlayerData() |
|
|
|
let currentPlayerData = dataStore.user.currentPlayerData() |
|
|
|
Section { |
|
|
|
Section { |
|
|
|
if let currentPlayerData { |
|
|
|
if let currentPlayerData { |
|
|
|
//todo palmares |
|
|
|
//todo palmares |
|
|
|
ImportedPlayerView(player: currentPlayerData) |
|
|
|
ImportedPlayerView(player: currentPlayerData) |
|
|
|
.contextMenu { |
|
|
|
|
|
|
|
Button("Copier ma licence") { |
|
|
|
|
|
|
|
UIPasteboard.general.string = currentPlayerData.formattedLicense() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Button("Supprimer ma fiche") { |
|
|
|
|
|
|
|
dataStore.user.licenceId = nil |
|
|
|
|
|
|
|
self.dataStore.saveUser() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// NavigationLink { |
|
|
|
// NavigationLink { |
|
|
|
// |
|
|
|
// |
|
|
|
// } label: { |
|
|
|
// } label: { |
|
|
|
@ -88,6 +87,25 @@ struct UmpireView: View { |
|
|
|
} footer: { |
|
|
|
} footer: { |
|
|
|
if dataStore.user.licenceId == nil { |
|
|
|
if dataStore.user.licenceId == nil { |
|
|
|
Text("Si vous avez participé à un tournoi dans les 12 derniers mois, Padel Club peut vous retrouver.") |
|
|
|
Text("Si vous avez participé à un tournoi dans les 12 derniers mois, Padel Club peut vous retrouver.") |
|
|
|
|
|
|
|
} else if let currentPlayerData { |
|
|
|
|
|
|
|
Menu { |
|
|
|
|
|
|
|
Button { |
|
|
|
|
|
|
|
UIPasteboard.general.string = currentPlayerData.formattedLicense() |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
Text("Copier ma licence") |
|
|
|
|
|
|
|
Text(currentPlayerData.formattedLicense()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Button("Supprimer ma fiche") { |
|
|
|
|
|
|
|
dataStore.user.licenceId = nil |
|
|
|
|
|
|
|
self.dataStore.saveUser() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
Text("options") |
|
|
|
|
|
|
|
.foregroundStyle(Color.master) |
|
|
|
|
|
|
|
.underline() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -112,7 +130,7 @@ struct UmpireView: View { |
|
|
|
if let _lastDataSourceDate { |
|
|
|
if let _lastDataSourceDate { |
|
|
|
LabeledContent { |
|
|
|
LabeledContent { |
|
|
|
Image(systemName: "checkmark.circle.fill") |
|
|
|
Image(systemName: "checkmark.circle.fill") |
|
|
|
.tint(.green) |
|
|
|
.foregroundStyle(.green) |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Text(_lastDataSourceDate.monthYearFormatted) |
|
|
|
Text(_lastDataSourceDate.monthYearFormatted) |
|
|
|
Text("Classement mensuel utilisé") |
|
|
|
Text("Classement mensuel utilisé") |
|
|
|
|