You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.4 KiB
55 lines
1.4 KiB
//
|
|
// CallSettingsView.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Razmig Sarkissian on 16/04/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct CallSettingsView: View {
|
|
@EnvironmentObject var dataStore: DataStore
|
|
@Environment(Tournament.self) var tournament: Tournament
|
|
|
|
var body: some View {
|
|
List {
|
|
|
|
Section {
|
|
NavigationLink {
|
|
} label: {
|
|
Text("Modifier le message de convocation")
|
|
}
|
|
}
|
|
|
|
Section {
|
|
RowButtonView("Annuler toutes les convocations") {
|
|
let teams = tournament.unsortedTeams()
|
|
teams.forEach { team in
|
|
team.callDate = nil
|
|
}
|
|
try? dataStore.teamRegistrations.addOrUpdate(contentOfs: teams)
|
|
}
|
|
}
|
|
|
|
Section {
|
|
RowButtonView("Envoyer un message à tout le monde") {
|
|
|
|
}
|
|
}
|
|
|
|
Section {
|
|
RowButtonView("Tout le monde a été convoqué") {
|
|
let teams = tournament.unsortedTeams()
|
|
teams.forEach { team in
|
|
team.callDate = Date()
|
|
}
|
|
try? dataStore.teamRegistrations.addOrUpdate(contentOfs: teams)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
CallSettingsView()
|
|
}
|
|
|