🎨 Changed primary/secondary color to camelCase

This commit is contained in:
Aimsucks
2022-06-07 17:48:04 +00:00
parent 423f8110b9
commit b26ab50c8d
9 changed files with 17 additions and 17 deletions

View File

@@ -40,7 +40,7 @@ export function ColorSchemeSwitch() {
<Sun className={cx(classes.icon, classes.iconLight)} size={18} /> <Sun className={cx(classes.icon, classes.iconLight)} size={18} />
<MoonStars className={cx(classes.icon, classes.iconDark)} size={18} /> <MoonStars className={cx(classes.icon, classes.iconDark)} size={18} />
<Switch <Switch
color={config.settings.primary_color || 'red'} color={config.settings.primaryColor || 'red'}
checked={colorScheme === 'dark'} checked={colorScheme === 'dark'}
onChange={() => toggleColorScheme()} onChange={() => toggleColorScheme()}
size="md" size="md"

View File

@@ -63,7 +63,7 @@ export default function SaveConfigComponent(props: any) {
size="xs" size="xs"
leftIcon={<Download />} leftIcon={<Download />}
variant="outline" variant="outline"
color={config.settings.primary_color || 'red'} color={config.settings.primaryColor || 'red'}
onClick={onClick} onClick={onClick}
> >
Download config Download config
@@ -72,7 +72,7 @@ export default function SaveConfigComponent(props: any) {
size="xs" size="xs"
leftIcon={<Trash />} leftIcon={<Trash />}
variant="outline" variant="outline"
color={config.settings.primary_color || 'red'} color={config.settings.primaryColor || 'red'}
onClick={() => { onClick={() => {
axios axios
.delete(`/api/configs/${config.name}`) .delete(`/api/configs/${config.name}`)
@@ -105,7 +105,7 @@ export default function SaveConfigComponent(props: any) {
size="xs" size="xs"
leftIcon={<Plus />} leftIcon={<Plus />}
variant="outline" variant="outline"
color={config.settings.primary_color || 'red'} color={config.settings.primaryColor || 'red'}
onClick={() => setOpened(true)} onClick={() => setOpened(true)}
> >
Save a copy Save a copy

View File

@@ -44,7 +44,7 @@ export default function TitleChanger() {
{...form.getInputProps('favicon')} {...form.getInputProps('favicon')}
/> />
<TextInput label="Background" placeholder="" {...form.getInputProps('background')} /> <TextInput label="Background" placeholder="" {...form.getInputProps('background')} />
<Button type="submit" color={config.settings.primary_color || 'red'}> <Button type="submit" color={config.settings.primaryColor || 'red'}>
Save Save
</Button> </Button>
</Group> </Group>

View File

@@ -17,8 +17,8 @@ export function ColorSelector({ type }: ColorControlProps) {
const configColor = const configColor =
type === 'primary' type === 'primary'
? config.settings.primary_color || 'red' ? config.settings.primaryColor || 'red'
: config.settings.secondary_color || 'orange'; : config.settings.secondaryColor || 'orange';
const setConfigColor = (color: string) => { const setConfigColor = (color: string) => {
if (type === 'primary') { if (type === 'primary') {
@@ -26,7 +26,7 @@ export function ColorSelector({ type }: ColorControlProps) {
...config, ...config,
settings: { settings: {
...config.settings, ...config.settings,
primary_color: color, primaryColor: color,
}, },
}); });
} else { } else {
@@ -34,7 +34,7 @@ export function ColorSelector({ type }: ColorControlProps) {
...config, ...config,
settings: { settings: {
...config.settings, ...config.settings,
secondary_color: color, secondaryColor: color,
}, },
}); });
} }

View File

@@ -35,8 +35,8 @@ export default function CommonSettings(args: any) {
const theme = useMantineTheme(); const theme = useMantineTheme();
const colors = Object.keys(theme.colors).map((color) => theme.colors[color][6]); const colors = Object.keys(theme.colors).map((color) => theme.colors[color][6]);
const [primaryColor, setPrimaryColor] = useState(config.settings.primary_color); const [primaryColor, setPrimaryColor] = useState(config.settings.primaryColor);
const [secondaryColor, setSecondaryColor] = useState(config.settings.secondary_color); const [secondaryColor, setSecondaryColor] = useState(config.settings.secondaryColor);
// const convertColorHexToNames = (hex: string) => { // const convertColorHexToNames = (hex: string) => {
// // Have to add some exceptions here because it's not converting cleanly // // Have to add some exceptions here because it's not converting cleanly

View File

@@ -13,7 +13,7 @@ export default function ModuleEnabler(props: any) {
size="md" size="md"
checked={config.modules?.[module.title]?.enabled ?? false} checked={config.modules?.[module.title]?.enabled ?? false}
label={`Enable ${module.title}`} label={`Enable ${module.title}`}
color={config.settings.primary_color || 'red'} color={config.settings.primaryColor || 'red'}
onChange={(e) => { onChange={(e) => {
setConfig({ setConfig({
...config, ...config,

View File

@@ -27,8 +27,8 @@ export function Logo({ style }: any) {
weight="bold" weight="bold"
variant="gradient" variant="gradient"
gradient={{ gradient={{
from: config.settings.primary_color || 'red', from: config.settings.primaryColor || 'red',
to: config.settings.secondary_color || 'orange', to: config.settings.secondaryColor || 'orange',
deg: 145, deg: 145,
}} }}
> >

View File

@@ -34,7 +34,7 @@ export default function App(props: AppProps & { colorScheme: ColorScheme }) {
<MantineProvider <MantineProvider
theme={{ theme={{
...theme, ...theme,
primaryColor: config.settings.primary_color || 'red', primaryColor: config.settings.primaryColor || 'red',
colorScheme, colorScheme,
}} }}
styles={{ styles={{

View File

@@ -5,8 +5,8 @@ export interface Settings {
title?: string; title?: string;
logo?: string; logo?: string;
favicon?: string; favicon?: string;
primary_color?: string; primaryColor?: string;
secondary_color?: string; secondaryColor?: string;
background?: string; background?: string;
} }