fix: color restrictions issue (#16360)
* fix: color restrictions issue * Update EventAdvancedTab.tsx
This commit is contained in:
@@ -582,14 +582,14 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
|
||||
<ColorPicker
|
||||
defaultValue={eventTypeColorState.lightEventTypeColor}
|
||||
onChange={(value) => {
|
||||
const newVal = {
|
||||
...eventTypeColorState,
|
||||
lightEventTypeColor: value,
|
||||
};
|
||||
formMethods.setValue("eventTypeColor", newVal, { shouldDirty: true });
|
||||
setEventTypeColorState(newVal);
|
||||
if (checkWCAGContrastColor("#ffffff", value)) {
|
||||
const newVal = {
|
||||
...eventTypeColorState,
|
||||
lightEventTypeColor: value,
|
||||
};
|
||||
setLightModeError(false);
|
||||
formMethods.setValue("eventTypeColor", newVal, { shouldDirty: true });
|
||||
setEventTypeColorState(newVal);
|
||||
} else {
|
||||
setLightModeError(true);
|
||||
}
|
||||
@@ -607,14 +607,14 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
|
||||
<ColorPicker
|
||||
defaultValue={eventTypeColorState.darkEventTypeColor}
|
||||
onChange={(value) => {
|
||||
const newVal = {
|
||||
...eventTypeColorState,
|
||||
darkEventTypeColor: value,
|
||||
};
|
||||
formMethods.setValue("eventTypeColor", newVal, { shouldDirty: true });
|
||||
setEventTypeColorState(newVal);
|
||||
if (checkWCAGContrastColor("#101010", value)) {
|
||||
const newVal = {
|
||||
...eventTypeColorState,
|
||||
darkEventTypeColor: value,
|
||||
};
|
||||
setDarkModeError(false);
|
||||
formMethods.setValue("eventTypeColor", newVal, { shouldDirty: true });
|
||||
setEventTypeColorState(newVal);
|
||||
} else {
|
||||
setDarkModeError(true);
|
||||
}
|
||||
|
||||
@@ -350,10 +350,10 @@ const AppearanceView = ({
|
||||
onChange={(value) => {
|
||||
if (checkWCAGContrastColor("#ffffff", value)) {
|
||||
setLightModeError(false);
|
||||
brandColorsFormMethods.setValue("brandColor", value, { shouldDirty: true });
|
||||
} else {
|
||||
setLightModeError(true);
|
||||
}
|
||||
brandColorsFormMethods.setValue("brandColor", value, { shouldDirty: true });
|
||||
}}
|
||||
/>
|
||||
{lightModeError ? (
|
||||
@@ -378,10 +378,10 @@ const AppearanceView = ({
|
||||
onChange={(value) => {
|
||||
if (checkWCAGContrastColor("#101010", value)) {
|
||||
setDarkModeError(false);
|
||||
brandColorsFormMethods.setValue("darkBrandColor", value, { shouldDirty: true });
|
||||
} else {
|
||||
setDarkModeError(true);
|
||||
}
|
||||
brandColorsFormMethods.setValue("darkBrandColor", value, { shouldDirty: true });
|
||||
}}
|
||||
/>
|
||||
{darkModeError ? (
|
||||
|
||||
@@ -68,10 +68,10 @@ const BrandColorsForm = ({
|
||||
onChange={(value) => {
|
||||
if (checkWCAGContrastColor("#ffffff", value)) {
|
||||
setLightModeError(false);
|
||||
brandColorsFormMethods.setValue("brandColor", value, { shouldDirty: true });
|
||||
} else {
|
||||
setLightModeError(true);
|
||||
}
|
||||
brandColorsFormMethods.setValue("brandColor", value, { shouldDirty: true });
|
||||
}}
|
||||
/>
|
||||
{lightModeError ? (
|
||||
@@ -96,10 +96,10 @@ const BrandColorsForm = ({
|
||||
onChange={(value) => {
|
||||
if (checkWCAGContrastColor("#101010", value)) {
|
||||
setDarkModeError(false);
|
||||
brandColorsFormMethods.setValue("darkBrandColor", value, { shouldDirty: true });
|
||||
} else {
|
||||
setDarkModeError(true);
|
||||
}
|
||||
brandColorsFormMethods.setValue("darkBrandColor", value, { shouldDirty: true });
|
||||
}}
|
||||
/>
|
||||
{darkModeError ? (
|
||||
|
||||
Reference in New Issue
Block a user