diff --git a/PadelClub/Views/Navigation/MainView.swift b/PadelClub/Views/Navigation/MainView.swift index 19e1fc2..cf823a2 100644 --- a/PadelClub/Views/Navigation/MainView.swift +++ b/PadelClub/Views/Navigation/MainView.swift @@ -69,16 +69,21 @@ struct MainView: View { } } } + .toolbarBackground(.visible, for: .tabBar) TournamentOrganizerView() .tabItem(for: .tournamentOrganizer) + .toolbarBackground(.visible, for: .tabBar) OngoingView() .tabItem(for: .ongoing) .badge(self.dataStore.runningMatches().count) + .toolbarBackground(.visible, for: .tabBar) ToolboxView() .tabItem(for: .toolbox) + .toolbarBackground(.visible, for: .tabBar) UmpireView() .tabItem(for: .umpire) .badge(badgeText) + .toolbarBackground(.visible, for: .tabBar) // PadelClubView() // .tabItem(for: .padelClub) } diff --git a/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift b/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift index 1382e5a..6c80e60 100644 --- a/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift +++ b/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift @@ -776,7 +776,7 @@ struct InscriptionManagerView: View { } .buttonBorderShape(.roundedRectangle) .buttonStyle(.borderedProminent) - .foregroundStyle(.primary) + .foregroundStyle(self.filterMode == filterMode ? Color.white : Color.black) .tint(self.filterMode == filterMode ? .master : .beige) } diff --git a/PadelClub/Views/User/AccountView.swift b/PadelClub/Views/User/AccountView.swift index e7583dc..a45da3e 100644 --- a/PadelClub/Views/User/AccountView.swift +++ b/PadelClub/Views/User/AccountView.swift @@ -15,14 +15,17 @@ struct AccountView: View { var body: some View { Form { - NavigationLink("Changer de mot de passe") { - ChangePasswordView() + Section { + NavigationLink("Changer de mot de passe") { + ChangePasswordView() + } } - RowButtonView("Déconnexion", role: .destructive) { - DataStore.shared.disconnect() - handler() + Section { + RowButtonView("Déconnexion", role: .destructive) { + DataStore.shared.disconnect() + handler() + } } - Section { RowButtonView("Supprimer mon compte", role: .destructive, confirmationMessage: "Voulez-vous vraiment supprimer définitivement votre compte et ses données associées ?") { DataStore.shared.deleteAccount() diff --git a/PadelClub/Views/User/ChangePasswordView.swift b/PadelClub/Views/User/ChangePasswordView.swift index 544a27c..9c445f6 100644 --- a/PadelClub/Views/User/ChangePasswordView.swift +++ b/PadelClub/Views/User/ChangePasswordView.swift @@ -29,21 +29,15 @@ struct ChangePasswordView: View { Form { - PasswordField("Old password", text: self.$oldPassword) - PasswordField("Password", text: self.$password1) - PasswordField("Password again", text: self.$password2) + PasswordField("Ancien mot de passe", text: self.$oldPassword) + PasswordField("Nouveau mot de passe", text: self.$password1) + PasswordField("Confirmer du nouveau mot de passe", text: self.$password2) Section { - Button(action: { - self._changePassword() - }, label: { - if self.isLoading { - Text("Changer de mot de passe") - } else { - ProgressView() - } - }) - .frame(maxWidth: .infinity) + RowButtonView("Changer de mot de passe", role: .destructive) { + await self._changePassword() + } + .disabled(isLoading) } footer: { if self.errorMessage.count > 0 { Text(self.errorMessage).foregroundStyle(.logoRed) @@ -60,26 +54,25 @@ struct ChangePasswordView: View { } } .navigationTitle("Changer de mot de passe") + .navigationBarTitleDisplayMode(.inline) + .toolbarBackground(.visible, for: .navigationBar) } - fileprivate func _changePassword() { - Task { - do { - self.isLoading = true - let service = try StoreCenter.main.service() - _ = try await service.changePassword( - oldPassword: self.oldPassword, - password1: self.password1, - password2: self.password2) - self.isLoading = false - self.showForm = false - } catch { - Logger.error(error) - self.errorMessage = ErrorUtils.message(error: error) - self.isLoading = false - } + fileprivate func _changePassword() async { + do { + self.isLoading = true + let service = try StoreCenter.main.service() + _ = try await service.changePassword( + oldPassword: self.oldPassword, + password1: self.password1, + password2: self.password2) + self.isLoading = false + self.showForm = false + } catch { + Logger.error(error) + self.errorMessage = ErrorUtils.message(error: error) + self.isLoading = false } - } } diff --git a/PadelClub/Views/User/LoginView.swift b/PadelClub/Views/User/LoginView.swift index 0e0b75f..6ce5f57 100644 --- a/PadelClub/Views/User/LoginView.swift +++ b/PadelClub/Views/User/LoginView.swift @@ -114,7 +114,6 @@ struct LoginView: View { focusedField = .password } PasswordField("Mot de passe", text: self.$password) - .textContentType(.init(rawValue: "")) .submitLabel(.send) .onSubmit(of: .text) { if password.isEmpty == false && username.isEmpty == false {