From 52d21b9ddab916acdbc4300f7c9fffe1c548adb6 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Thu, 20 Jul 2023 16:51:00 +0530 Subject: [PATCH] chore: notification empty state overflow (#1592) * chore: notification empty state overflow * fix: white logo * fix: custom theme default values * fix: custom theme default values --- .../core/theme/custom-theme-selector.tsx | 2 +- apps/app/components/core/theme/theme-switch.tsx | 17 ++++++++++++++++- .../notifications/notification-popover.tsx | 2 +- apps/app/contexts/theme.context.tsx | 7 ++++++- .../[workspaceSlug]/me/profile/preferences.tsx | 17 ++++++++++++++++- .../white-horizontal-with-blue-logo.svg | 10 +++++----- 6 files changed, 45 insertions(+), 10 deletions(-) diff --git a/apps/app/components/core/theme/custom-theme-selector.tsx b/apps/app/components/core/theme/custom-theme-selector.tsx index 5f36115f8..40450ee2c 100644 --- a/apps/app/components/core/theme/custom-theme-selector.tsx +++ b/apps/app/components/core/theme/custom-theme-selector.tsx @@ -69,8 +69,8 @@ export const CustomThemeSelector: React.FC = ({ preLoadedData }) => { return { ...prevData, ...res }; }, false); - applyTheme(payload.palette, darkPalette); setTheme("custom"); + applyTheme(payload.palette, darkPalette); }) .catch((err) => console.log(err)); }; diff --git a/apps/app/components/core/theme/theme-switch.tsx b/apps/app/components/core/theme/theme-switch.tsx index 8929015ee..39b570bc5 100644 --- a/apps/app/components/core/theme/theme-switch.tsx +++ b/apps/app/components/core/theme/theme-switch.tsx @@ -71,7 +71,21 @@ export const ThemeSwitch: React.FC = ({ } onChange={({ value, type }: { value: string; type: string }) => { if (value === "custom") { - if (user?.theme.palette) setPreLoadedData(user.theme); + if (user?.theme.palette) { + setPreLoadedData({ + background: user.theme.background !== "" ? user.theme.background : "#0d101b", + text: user.theme.text !== "" ? user.theme.text : "#c5c5c5", + primary: user.theme.primary !== "" ? user.theme.primary : "#3f76ff", + sidebarBackground: + user.theme.sidebarBackground !== "" ? user.theme.sidebarBackground : "#0d101b", + sidebarText: user.theme.sidebarText !== "" ? user.theme.sidebarText : "#c5c5c5", + darkPalette: false, + palette: + user.theme.palette !== ",,,," + ? user.theme.palette + : "#0d101b,#c5c5c5,#3f76ff,#0d101b,#c5c5c5", + }); + } if (!customThemeSelectorOptions) setCustomThemeSelectorOptions(true); } else { @@ -87,6 +101,7 @@ export const ThemeSwitch: React.FC = ({ document.documentElement.style.removeProperty(`--color-sidebar-border-${i}`); } } + setTheme(value); document.documentElement.style.setProperty("color-scheme", type); }} diff --git a/apps/app/components/notifications/notification-popover.tsx b/apps/app/components/notifications/notification-popover.tsx index a8652e7ff..255d8af04 100644 --- a/apps/app/components/notifications/notification-popover.tsx +++ b/apps/app/components/notifications/notification-popover.tsx @@ -274,7 +274,7 @@ export const NotificationPopover = () => { ))} ) : ( -
+
= ({ const theme = localStorage.getItem("theme"); if (theme && theme === "custom") { if (user && user.theme.palette) { - applyTheme(user.theme.palette, user.theme.darkPalette); + applyTheme( + user.theme.palette !== ",,,," + ? user.theme.palette + : "#0d101b,#c5c5c5,#3f76ff,#0d101b,#c5c5c5", + user.theme.darkPalette + ); } } }, [user]); diff --git a/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx b/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx index 64b598f7f..605131aa4 100644 --- a/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx +++ b/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx @@ -22,7 +22,22 @@ const ProfilePreferences = () => { useEffect(() => { if (theme === "custom") { - if (myProfile?.theme.palette) setPreLoadedData(myProfile.theme); + if (myProfile?.theme.palette) + setPreLoadedData({ + background: myProfile.theme.background !== "" ? myProfile.theme.background : "#0d101b", + text: myProfile.theme.text !== "" ? myProfile.theme.text : "#c5c5c5", + primary: myProfile.theme.primary !== "" ? myProfile.theme.primary : "#3f76ff", + sidebarBackground: + myProfile.theme.sidebarBackground !== "" + ? myProfile.theme.sidebarBackground + : "#0d101b", + sidebarText: myProfile.theme.sidebarText !== "" ? myProfile.theme.sidebarText : "#c5c5c5", + darkPalette: false, + palette: + myProfile.theme.palette !== ",,,," + ? myProfile.theme.palette + : "#0d101b,#c5c5c5,#3f76ff,#0d101b,#c5c5c5", + }); if (!customThemeSelectorOptions) setCustomThemeSelectorOptions(true); } }, [myProfile, theme, customThemeSelectorOptions]); diff --git a/apps/app/public/plane-logos/white-horizontal-with-blue-logo.svg b/apps/app/public/plane-logos/white-horizontal-with-blue-logo.svg index d8cc6f4ef..1f09cc34a 100644 --- a/apps/app/public/plane-logos/white-horizontal-with-blue-logo.svg +++ b/apps/app/public/plane-logos/white-horizontal-with-blue-logo.svg @@ -1,10 +1,10 @@ - - - - - + + + + +