From b26ab50c8de2e65fef79476667c145068ea40834 Mon Sep 17 00:00:00 2001 From: Aimsucks Date: Tue, 7 Jun 2022 17:48:04 +0000 Subject: [PATCH] :art: Changed primary/secondary color to camelCase --- src/components/ColorSchemeToggle/ColorSchemeSwitch.tsx | 2 +- src/components/Config/SaveConfig.tsx | 6 +++--- src/components/Settings/AdvancedSettings.tsx | 2 +- src/components/Settings/ColorSelector.tsx | 8 ++++---- src/components/Settings/CommonSettings.tsx | 4 ++-- src/components/Settings/ModuleEnabler.tsx | 2 +- src/components/layout/Logo.tsx | 4 ++-- src/pages/_app.tsx | 2 +- src/tools/types.ts | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/components/ColorSchemeToggle/ColorSchemeSwitch.tsx b/src/components/ColorSchemeToggle/ColorSchemeSwitch.tsx index 9e43a3500..d9c2cd035 100644 --- a/src/components/ColorSchemeToggle/ColorSchemeSwitch.tsx +++ b/src/components/ColorSchemeToggle/ColorSchemeSwitch.tsx @@ -40,7 +40,7 @@ export function ColorSchemeSwitch() { toggleColorScheme()} size="md" diff --git a/src/components/Config/SaveConfig.tsx b/src/components/Config/SaveConfig.tsx index 79bff863d..882f43299 100644 --- a/src/components/Config/SaveConfig.tsx +++ b/src/components/Config/SaveConfig.tsx @@ -63,7 +63,7 @@ export default function SaveConfigComponent(props: any) { size="xs" leftIcon={} variant="outline" - color={config.settings.primary_color || 'red'} + color={config.settings.primaryColor || 'red'} onClick={onClick} > Download config @@ -72,7 +72,7 @@ export default function SaveConfigComponent(props: any) { size="xs" leftIcon={} variant="outline" - color={config.settings.primary_color || 'red'} + color={config.settings.primaryColor || 'red'} onClick={() => { axios .delete(`/api/configs/${config.name}`) @@ -105,7 +105,7 @@ export default function SaveConfigComponent(props: any) { size="xs" leftIcon={} variant="outline" - color={config.settings.primary_color || 'red'} + color={config.settings.primaryColor || 'red'} onClick={() => setOpened(true)} > Save a copy diff --git a/src/components/Settings/AdvancedSettings.tsx b/src/components/Settings/AdvancedSettings.tsx index 0840517fd..45d57bb87 100644 --- a/src/components/Settings/AdvancedSettings.tsx +++ b/src/components/Settings/AdvancedSettings.tsx @@ -44,7 +44,7 @@ export default function TitleChanger() { {...form.getInputProps('favicon')} /> - diff --git a/src/components/Settings/ColorSelector.tsx b/src/components/Settings/ColorSelector.tsx index c54d2dae4..d70ab1d59 100644 --- a/src/components/Settings/ColorSelector.tsx +++ b/src/components/Settings/ColorSelector.tsx @@ -17,8 +17,8 @@ export function ColorSelector({ type }: ColorControlProps) { const configColor = type === 'primary' - ? config.settings.primary_color || 'red' - : config.settings.secondary_color || 'orange'; + ? config.settings.primaryColor || 'red' + : config.settings.secondaryColor || 'orange'; const setConfigColor = (color: string) => { if (type === 'primary') { @@ -26,7 +26,7 @@ export function ColorSelector({ type }: ColorControlProps) { ...config, settings: { ...config.settings, - primary_color: color, + primaryColor: color, }, }); } else { @@ -34,7 +34,7 @@ export function ColorSelector({ type }: ColorControlProps) { ...config, settings: { ...config.settings, - secondary_color: color, + secondaryColor: color, }, }); } diff --git a/src/components/Settings/CommonSettings.tsx b/src/components/Settings/CommonSettings.tsx index 5f347fe0a..dd4069379 100644 --- a/src/components/Settings/CommonSettings.tsx +++ b/src/components/Settings/CommonSettings.tsx @@ -35,8 +35,8 @@ export default function CommonSettings(args: any) { const theme = useMantineTheme(); const colors = Object.keys(theme.colors).map((color) => theme.colors[color][6]); - const [primaryColor, setPrimaryColor] = useState(config.settings.primary_color); - const [secondaryColor, setSecondaryColor] = useState(config.settings.secondary_color); + const [primaryColor, setPrimaryColor] = useState(config.settings.primaryColor); + const [secondaryColor, setSecondaryColor] = useState(config.settings.secondaryColor); // const convertColorHexToNames = (hex: string) => { // // Have to add some exceptions here because it's not converting cleanly diff --git a/src/components/Settings/ModuleEnabler.tsx b/src/components/Settings/ModuleEnabler.tsx index 0d636e77d..f2061540a 100644 --- a/src/components/Settings/ModuleEnabler.tsx +++ b/src/components/Settings/ModuleEnabler.tsx @@ -13,7 +13,7 @@ export default function ModuleEnabler(props: any) { size="md" checked={config.modules?.[module.title]?.enabled ?? false} label={`Enable ${module.title}`} - color={config.settings.primary_color || 'red'} + color={config.settings.primaryColor || 'red'} onChange={(e) => { setConfig({ ...config, diff --git a/src/components/layout/Logo.tsx b/src/components/layout/Logo.tsx index 48ff1eb0a..9ebd74395 100644 --- a/src/components/layout/Logo.tsx +++ b/src/components/layout/Logo.tsx @@ -27,8 +27,8 @@ export function Logo({ style }: any) { weight="bold" variant="gradient" gradient={{ - from: config.settings.primary_color || 'red', - to: config.settings.secondary_color || 'orange', + from: config.settings.primaryColor || 'red', + to: config.settings.secondaryColor || 'orange', deg: 145, }} > diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 939ec0175..f923e310b 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -34,7 +34,7 @@ export default function App(props: AppProps & { colorScheme: ColorScheme }) {