[WEB-5772] chore: theme switcher and editor colors enhancements (#8436)
This commit is contained in:
parent
6cd85a7095
commit
2bc7080d24
10 changed files with 142 additions and 16 deletions
|
|
@ -72,8 +72,12 @@ export const CustomThemeSelector = observer(function CustomThemeSelector() {
|
|||
setToast({
|
||||
type: TOAST_TYPE.SUCCESS,
|
||||
title: t("success"),
|
||||
message: t("theme_updated_successfully"),
|
||||
message: "Reloading to apply changes...",
|
||||
});
|
||||
// reload the page after showing the toast
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1500);
|
||||
} catch (error) {
|
||||
console.error("Failed to apply theme:", error);
|
||||
setToast({
|
||||
|
|
|
|||
|
|
@ -28,9 +28,14 @@ export const usePowerKPreferencesCommands = (): TPowerKCommandConfig[] => {
|
|||
.then(() => {
|
||||
setToast({
|
||||
type: TOAST_TYPE.SUCCESS,
|
||||
title: t("toast.success"),
|
||||
message: t("power_k.preferences_actions.toast.theme.success"),
|
||||
title: "Theme updated",
|
||||
message: "Reloading to apply changes...",
|
||||
});
|
||||
// reload the page after showing the toast
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1500);
|
||||
return;
|
||||
})
|
||||
.catch(() => {
|
||||
setToast({
|
||||
|
|
@ -38,6 +43,7 @@ export const usePowerKPreferencesCommands = (): TPowerKCommandConfig[] => {
|
|||
title: t("toast.error"),
|
||||
message: t("power_k.preferences_actions.toast.theme.error"),
|
||||
});
|
||||
return;
|
||||
});
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
@ -53,6 +59,7 @@ export const usePowerKPreferencesCommands = (): TPowerKCommandConfig[] => {
|
|||
title: t("toast.success"),
|
||||
message: t("power_k.preferences_actions.toast.timezone.success"),
|
||||
});
|
||||
return;
|
||||
})
|
||||
.catch(() => {
|
||||
setToast({
|
||||
|
|
@ -60,6 +67,7 @@ export const usePowerKPreferencesCommands = (): TPowerKCommandConfig[] => {
|
|||
title: t("toast.error"),
|
||||
message: t("power_k.preferences_actions.toast.timezone.error"),
|
||||
});
|
||||
return;
|
||||
});
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
@ -75,6 +83,7 @@ export const usePowerKPreferencesCommands = (): TPowerKCommandConfig[] => {
|
|||
title: t("toast.success"),
|
||||
message: t("power_k.preferences_actions.toast.generic.success"),
|
||||
});
|
||||
return;
|
||||
})
|
||||
.catch(() => {
|
||||
setToast({
|
||||
|
|
@ -82,6 +91,7 @@ export const usePowerKPreferencesCommands = (): TPowerKCommandConfig[] => {
|
|||
title: t("toast.error"),
|
||||
message: t("power_k.preferences_actions.toast.generic.error"),
|
||||
});
|
||||
return;
|
||||
});
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
@ -98,7 +108,7 @@ export const usePowerKPreferencesCommands = (): TPowerKCommandConfig[] => {
|
|||
icon: Palette,
|
||||
onSelect: (data) => {
|
||||
const theme = data as string;
|
||||
handleUpdateTheme(theme);
|
||||
void handleUpdateTheme(theme);
|
||||
},
|
||||
isEnabled: () => true,
|
||||
isVisible: () => true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue