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.
 
 
PadelClub/PadelClub/Views/Calling/CallSettingsView.swift

56 lines
1.5 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 {
CallMessageCustomizationView(tournament: tournament)
} label: {
Text("Personnaliser le message de convocation")
}
}
Section {
RowButtonView("Envoyer un message à tout le monde") {
}
}
Section {
RowButtonView("Annuler toutes les convocations", role: .destructive) {
let teams = tournament.unsortedTeams()
teams.forEach { team in
team.callDate = nil
}
try? dataStore.teamRegistrations.addOrUpdate(contentOfs: teams)
}
}
Section {
RowButtonView("Tout le monde a été convoqué", role: .destructive) {
let teams = tournament.unsortedTeams()
teams.forEach { team in
team.callDate = Date()
}
try? dataStore.teamRegistrations.addOrUpdate(contentOfs: teams)
}
}
}
}
}
#Preview {
CallSettingsView()
}