|
|
|
|
@ -23,6 +23,20 @@ struct EventSettingsView: View { |
|
|
|
|
var link = [String]() |
|
|
|
|
link.append(event.eventTitle()) |
|
|
|
|
|
|
|
|
|
link.append("\n\n") |
|
|
|
|
|
|
|
|
|
link.append(tournamentInformation) |
|
|
|
|
|
|
|
|
|
link.append("\n\n") |
|
|
|
|
|
|
|
|
|
if let url = event.shareURL() { |
|
|
|
|
var tournamentLink = [String]() |
|
|
|
|
tournamentLink.append("Lien de l'événement") |
|
|
|
|
tournamentLink.append(url.absoluteString) |
|
|
|
|
let eventLink = tournamentLink.joined(separator: "\n") |
|
|
|
|
link.append(eventLink) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
link.append("\n\n") |
|
|
|
|
link.append("Retrouvez toutes les infos en suivant le\(tournaments.count.pluralSuffix) lien\(tournaments.count.pluralSuffix) ci-dessous :") |
|
|
|
|
link.append("\n\n") |
|
|
|
|
@ -150,12 +164,8 @@ struct EventSettingsView: View { |
|
|
|
|
}) |
|
|
|
|
.toolbarBackground(.visible, for: .navigationBar) |
|
|
|
|
.toolbar { |
|
|
|
|
if let tenupId = event.tenupId { |
|
|
|
|
ToolbarItem(placement: .topBarTrailing) { |
|
|
|
|
Link(destination: URL(string:"https://tenup.fft.fr/tournoi/\(tenupId)")!) { |
|
|
|
|
Text("Tenup") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ToolbarItem(placement: .topBarTrailing) { |
|
|
|
|
_linkLabel() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if focusedField != nil { |
|
|
|
|
@ -200,6 +210,23 @@ struct EventSettingsView: View { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private func _linkLabel() -> some View { |
|
|
|
|
Menu { |
|
|
|
|
if let url = event.shareURL() { |
|
|
|
|
ShareLink(item: url) { |
|
|
|
|
Text("Lien de l'événement sur Padel Club") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if let tenupId = event.tenupId { |
|
|
|
|
ShareLink(item: URL(string:"https://tenup.fft.fr/tournoi/\(tenupId)")!) { |
|
|
|
|
Text("Tenup") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} label: { |
|
|
|
|
Text("Liens") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private func _save() { |
|
|
|
|
dataStore.events.addOrUpdate(instance: event) |
|
|
|
|
} |
|
|
|
|
|