import { useEffect, useState } from "react"; // hooks import useUserAuth from "hooks/use-user-auth"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; import SettingsNavbar from "layouts/settings-navbar"; // components import { CustomThemeSelector, ThemeSwitch } from "components/core"; // ui import { Spinner } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; // types import { ICustomTheme } from "types"; // mobx react lite import { observer } from "mobx-react-lite"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; const ProfilePreferences = observer(() => { const { user: myProfile } = useUserAuth(); const store: any = useMobxStore(); // console.log("store", store?.theme?.theme); // console.log("theme", theme); const [customThemeSelectorOptions, setCustomThemeSelectorOptions] = useState(false); const [preLoadedData, setPreLoadedData] = useState(null); useEffect(() => { if (store?.user && store?.theme?.theme === "custom") { const currentTheme = store?.user?.currentUserSettings?.theme; if (currentTheme.palette) setPreLoadedData({ background: currentTheme.background !== "" ? currentTheme.background : "#0d101b", text: currentTheme.text !== "" ? currentTheme.text : "#c5c5c5", primary: currentTheme.primary !== "" ? currentTheme.primary : "#3f76ff", sidebarBackground: currentTheme.sidebarBackground !== "" ? currentTheme.sidebarBackground : "#0d101b", sidebarText: currentTheme.sidebarText !== "" ? currentTheme.sidebarText : "#c5c5c5", darkPalette: false, palette: currentTheme.palette !== ",,,," ? currentTheme.palette : "#0d101b,#c5c5c5,#3f76ff,#0d101b,#c5c5c5", theme: "custom", }); setCustomThemeSelectorOptions((prevData) => true); } }, [store, store?.theme?.theme]); return ( } > {myProfile ? (

Profile Settings

This information will be visible to only you.

Theme

Select or customize your interface color scheme.

{customThemeSelectorOptions && }
) : (
)}
); }); export default ProfilePreferences;