diff --git a/apps/web/pages/settings/my-account/appearance.tsx b/apps/web/pages/settings/my-account/appearance.tsx index dacdf8dd3f..a2f0bb36b9 100644 --- a/apps/web/pages/settings/my-account/appearance.tsx +++ b/apps/web/pages/settings/my-account/appearance.tsx @@ -1,5 +1,6 @@ "use client"; +import { useSession } from "next-auth/react"; import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; import type { z } from "zod"; @@ -94,6 +95,8 @@ const AppearanceView = ({ }) => { const { t } = useLocale(); const utils = trpc.useUtils(); + const session = useSession(); + const isApartOfOrganization = session.data?.user.org?.id; const [darkModeError, setDarkModeError] = useState(false); const [lightModeError, setLightModeError] = useState(false); const [isCustomBrandColorChecked, setIsCustomBranColorChecked] = useState( @@ -237,172 +240,176 @@ const AppearanceView = ({ -
-
-

{t("theme")}

-

{t("theme_applies_note")}

-
-
-
{ - mutation.mutate({ - // Radio values don't support null as values, therefore we convert an empty string - // back to null here. - theme: values.theme === "" ? null : values.theme, - }); - }}> -
- - - -
- - - -
- -
{ - const layoutError = validateBookerLayouts(values?.metadata?.defaultBookerLayouts || null); - if (layoutError) { - showToast(t(layoutError), "error"); - return; - } else { - mutation.mutate(values); - } - }}> - - - -
{ - mutation.mutate(values); - }}> -
- { - setIsCustomBranColorChecked(checked); - if (!checked) { - mutation.mutate({ - brandColor: DEFAULT_LIGHT_BRAND_COLOR, - darkBrandColor: DEFAULT_DARK_BRAND_COLOR, - }); - } - }} - childrenClassName="lg:ml-0"> -
- ( -
-

{t("light_brand_color")}

- { - try { - checkWCAGContrastColor("#ffffff", value); - setLightModeError(false); - brandColorsFormMethods.setValue("brandColor", value, { shouldDirty: true }); - } catch (err) { - setLightModeError(false); - } - }} - /> - {lightModeError ? ( -
- -
- ) : null} -
- )} + {isApartOfOrganization ? null : ( + <> +
+
+

{t("theme")}

+

{t("theme_applies_note")}

+
+
+ { + mutation.mutate({ + // Radio values don't support null as values, therefore we convert an empty string + // back to null here. + theme: values.theme === "" ? null : values.theme, + }); + }}> +
+ - - ( -
-

{t("dark_brand_color")}

- { - try { - checkWCAGContrastColor("#101010", value); - setDarkModeError(false); - brandColorsFormMethods.setValue("darkBrandColor", value, { shouldDirty: true }); - } catch (err) { - setDarkModeError(true); - } - }} - /> - {darkModeError ? ( -
- -
- ) : null} -
- )} + +
- + - -
- + - {/* TODO future PR to preview brandColors */} - {/* + +
+
+ + + {/* TODO future PR to preview brandColors */} + {/*