mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-09 15:05:48 +01:00
🎨 Changed primary/secondary color to camelCase
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -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={{
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user