From 99132f9a7cb505e7dd002550b4c749277e67740f Mon Sep 17 00:00:00 2001 From: valentinkolb Date: Thu, 13 Jun 2024 18:52:04 +0200 Subject: [PATCH] feat(EmailNotifications): users can specify that they dont want email notifications --- src/components/users/modals/UserMenuModal.tsx | 42 +++++++++++-------- src/models/AuthTypes.ts | 9 ++-- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/components/users/modals/UserMenuModal.tsx b/src/components/users/modals/UserMenuModal.tsx index 5c14c75..0624f3a 100644 --- a/src/components/users/modals/UserMenuModal.tsx +++ b/src/components/users/modals/UserMenuModal.tsx @@ -52,6 +52,7 @@ export default function UserMenuModal() { initialValues: { sn: user?.sn ?? "", givenName: user?.givenName ?? "", + muteEmailNotifications: user?.muteEmailNotifications ?? false }, validate: { sn: isNotEmpty('Bitte gebe deinen Nachnamen ein'), @@ -157,9 +158,9 @@ export default function UserMenuModal() { - {(user?.memberOf?.length ?? 0) > 0 && <> + {user?.expand?.memberOf !== undefined && <> Deine Gruppen - + } @@ -218,22 +219,29 @@ export default function UserMenuModal() { } - - {user?.REALM === "GUEST" && <> - - { - mutation.mutate() - }} - color={"green"} - disabled={!formValues.isTouched()} - > - - - + + + + { + mutation.mutate() + }} + color={"green"} + disabled={!formValues.isTouched()} + > + + + + + {user?.REALM === "GUEST" && <>