diff --git a/src/components/Settings/Customization/CustomizationSettings.tsx b/src/components/Settings/Customization/CustomizationSettings.tsx index 585389291..5b6def2dc 100644 --- a/src/components/Settings/Customization/CustomizationSettings.tsx +++ b/src/components/Settings/Customization/CustomizationSettings.tsx @@ -1,35 +1,53 @@ -import { Stack } from '@mantine/core'; +import { Button, ScrollArea, Stack } from '@mantine/core'; import { useConfigContext } from '../../../config/provider'; -import { ColorSelector } from './Theme/ColorSelector'; +import { useConfigStore } from '../../../config/store'; +import { LayoutSelector } from './Layout/LayoutSelector'; import { BackgroundChanger } from './Meta/BackgroundChanger'; -import { CustomCssChanger } from './Theme/CustomCssChanger'; import { FaviconChanger } from './Meta/FaviconChanger'; import { LogoImageChanger } from './Meta/LogoImageChanger'; import { MetaTitleChanger } from './Meta/MetaTitleChanger'; import { PageTitleChanger } from './Meta/PageTitleChanger'; +import { ColorSelector } from './Theme/ColorSelector'; +import { CustomCssChanger } from './Theme/CustomCssChanger'; import { OpacitySelector } from './Theme/OpacitySelector'; import { ShadeSelector } from './Theme/ShadeSelector'; -import { LayoutSelector } from './Layout/LayoutSelector'; export default function CustomizationSettings() { - const { config } = useConfigContext(); + const { config, name: configName } = useConfigContext(); + + const { updateConfig } = useConfigStore(); + + const saveConfiguration = () => { + if (!configName || !config) { + return; + } + + updateConfig(configName, (_) => config, false, true); + }; return ( - - - - - - - - - - - + + + + + + + + + + + + + + + ); } diff --git a/src/components/Settings/SettingsDrawer.tsx b/src/components/Settings/SettingsDrawer.tsx index f951ae585..bdd4bc4e8 100644 --- a/src/components/Settings/SettingsDrawer.tsx +++ b/src/components/Settings/SettingsDrawer.tsx @@ -1,9 +1,9 @@ -import { Title, Drawer, Tabs, ScrollArea } from '@mantine/core'; +import { Drawer, ScrollArea, Tabs, Title } from '@mantine/core'; import { useTranslation } from 'next-i18next'; -import CustomizationSettings from './Customization/CustomizationSettings'; import CommonSettings from './Common/CommonSettings'; import Credits from './Common/Credits'; +import CustomizationSettings from './Customization/CustomizationSettings'; function SettingsMenu({ newVersionAvailable }: { newVersionAvailable: string }) { const { t } = useTranslation('settings/common'); @@ -20,9 +20,7 @@ function SettingsMenu({ newVersionAvailable }: { newVersionAvailable: string }) - - - + );