diff --git a/apps/web/pages/settings/my-account/appearance.tsx b/apps/web/pages/settings/my-account/appearance.tsx index d65ef9c31b..8403619d68 100644 --- a/apps/web/pages/settings/my-account/appearance.tsx +++ b/apps/web/pages/settings/my-account/appearance.tsx @@ -52,6 +52,7 @@ const AppearanceView = () => { const utils = trpc.useContext(); const { data: user, isLoading } = trpc.viewer.me.useQuery(); const [darkModeError, setDarkModeError] = useState(false); + const [lightModeError, setLightModeError] = useState(false); const { isLoading: isTeamPlanStatusLoading, hasPaidPlan } = useHasPaidPlan(); @@ -145,7 +146,14 @@ const AppearanceView = () => {

{t("light_brand_color")}

formMethods.setValue("brandColor", value, { shouldDirty: true })} + onChange={(value) => { + if (!checkWCAGContrastColor("#ffffff", value)) { + setLightModeError(true); + } else { + setLightModeError(false); + } + formMethods.setValue("brandColor", value, { shouldDirty: true }); + }} /> )} @@ -180,6 +188,14 @@ const AppearanceView = () => { /> ) : null} + {lightModeError ? ( +
+ +
+ ) : null} {/* TODO future PR to preview brandColors */} {/*