diff --git a/PadelClub/Utils/PadelRule.swift b/PadelClub/Utils/PadelRule.swift index e595111..4156058 100644 --- a/PadelClub/Utils/PadelRule.swift +++ b/PadelClub/Utils/PadelRule.swift @@ -1134,7 +1134,7 @@ enum MatchFormat: Int, Hashable, Codable, CaseIterable { case .twoSetsSuperTie: return 80 case .twoSetsDecisivePointSuperTie: - return 75 + return 70 case .twoSetsOfFourGames: return 60 case .twoSetsOfFourGamesDecisivePoint: @@ -1142,11 +1142,11 @@ enum MatchFormat: Int, Hashable, Codable, CaseIterable { case .nineGames: return 45 case .nineGamesDecisivePoint: - return 35 + return 40 case .megaTie: - return 20 + return 30 case .superTie: - return 15 + return 25 } } diff --git a/PadelClub/Views/Navigation/MainView.swift b/PadelClub/Views/Navigation/MainView.swift index 97540ce..3b4daa1 100644 --- a/PadelClub/Views/Navigation/MainView.swift +++ b/PadelClub/Views/Navigation/MainView.swift @@ -48,6 +48,8 @@ struct MainView: View { dataStore.matches.filter({ $0.confirmed && $0.startDate != nil && $0.endDate == nil && $0.courtIndex != nil }) } + var badgeText: Text? = Store.main.userName() == nil ? Text("!").font(.headline) : nil + var body: some View { TabView(selection: selectedTabHandler) { ActivityView() @@ -61,10 +63,7 @@ struct MainView: View { .tabItem(for: .toolbox) UmpireView() .tabItem(for: .umpire) -// .badge( -// Text("!") -// .font(.headline) -// ) + .badge(badgeText) // PadelClubView() // .tabItem(for: .padelClub) } diff --git a/PadelClub/Views/Navigation/Umpire/UmpireView.swift b/PadelClub/Views/Navigation/Umpire/UmpireView.swift index 20e9b70..9638af4 100644 --- a/PadelClub/Views/Navigation/Umpire/UmpireView.swift +++ b/PadelClub/Views/Navigation/Umpire/UmpireView.swift @@ -57,7 +57,16 @@ struct UmpireView: View { NavigationLink { MainUserView() } label: { - Label("Mon compte", systemImage: "person.fill") + LabeledContent { + if Store.main.userName() != nil { + Text(dataStore.user.username) + } else { + Image(systemName: "xmark.circle.fill") + .foregroundStyle(.logoRed) + } + } label: { + Label("Mon compte", systemImage: "person.fill") + } } let currentPlayerData = dataStore.user.currentPlayerData() @@ -65,16 +74,6 @@ struct UmpireView: View { if let currentPlayerData { //todo palmares 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 { // // } label: { @@ -88,6 +87,25 @@ struct UmpireView: View { } footer: { if dataStore.user.licenceId == nil { 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 { LabeledContent { Image(systemName: "checkmark.circle.fill") - .tint(.green) + .foregroundStyle(.green) } label: { Text(_lastDataSourceDate.monthYearFormatted) Text("Classement mensuel utilisé") diff --git a/PadelClub/Views/Tournament/Shared/TournamentCellView.swift b/PadelClub/Views/Tournament/Shared/TournamentCellView.swift index 5777594..de792c7 100644 --- a/PadelClub/Views/Tournament/Shared/TournamentCellView.swift +++ b/PadelClub/Views/Tournament/Shared/TournamentCellView.swift @@ -52,8 +52,14 @@ struct TournamentCellView: View { // .frame(width: 2) VStack(alignment: .leading, spacing: 0.0) { if let tournament = tournament as? Tournament { - Text(tournament.locationLabel(displayStyle)) - .font(.caption) + HStack { + Text(tournament.locationLabel(displayStyle)) + .font(.caption) + Spacer() + if tournament.isPrivate { + Text("privé").foregroundStyle(.secondary) + } + } } else { Text(tournament.clubLabel()) .font(.caption)