mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 15:35:55 +01:00
Styling settings and translations
This commit is contained in:
@@ -31,6 +31,7 @@ import { CURRENT_VERSION } from '../../../data/constants';
|
|||||||
import { useConfigContext } from '../../config/provider';
|
import { useConfigContext } from '../../config/provider';
|
||||||
import { useConfigStore } from '../../config/store';
|
import { useConfigStore } from '../../config/store';
|
||||||
import { usePrimaryGradient } from '../layout/useGradient';
|
import { usePrimaryGradient } from '../layout/useGradient';
|
||||||
|
import Credits from '../Settings/Common/Credits';
|
||||||
|
|
||||||
interface AboutModalProps {
|
interface AboutModalProps {
|
||||||
opened: boolean;
|
opened: boolean;
|
||||||
@@ -113,6 +114,7 @@ export const AboutModal = ({ opened, closeModal, newVersionAvailable }: AboutMod
|
|||||||
Discord
|
Discord
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
|
<Credits />
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Space, Stack, Text } from '@mantine/core';
|
import { ScrollArea, Space, Stack, Text } from '@mantine/core';
|
||||||
import { useConfigContext } from '../../../config/provider';
|
import { useConfigContext } from '../../../config/provider';
|
||||||
import ConfigChanger from '../../Config/ConfigChanger';
|
import ConfigChanger from '../../Config/ConfigChanger';
|
||||||
import ConfigActions from './Config/ConfigActions';
|
import ConfigActions from './Config/ConfigActions';
|
||||||
@@ -17,12 +17,14 @@ export default function CommonSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack mb="md" mr="sm">
|
<Stack mb="md" mt="xs">
|
||||||
<SearchEngineSelector searchEngine={config.settings.common.searchEngine} />
|
<ScrollArea style={{ height: '76vh' }} offsetScrollbars>
|
||||||
<Space />
|
<SearchEngineSelector searchEngine={config.settings.common.searchEngine} />
|
||||||
<LanguageSelect />
|
<Space />
|
||||||
<ConfigChanger />
|
<LanguageSelect />
|
||||||
<ConfigActions />
|
<ConfigChanger />
|
||||||
|
<ConfigActions />
|
||||||
|
</ScrollArea>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export default function ConfigActions() {
|
|||||||
closeModal={createCopyModal.close}
|
closeModal={createCopyModal.close}
|
||||||
initialConfigName={config.configProperties.name}
|
initialConfigName={config.configProperties.name}
|
||||||
/>
|
/>
|
||||||
<Flex gap="xs" justify="stretch">
|
<Flex gap="xs" mt="xs" justify="stretch">
|
||||||
<ActionIcon className={classes.actionIcon} onClick={handleDownload} variant="default">
|
<ActionIcon className={classes.actionIcon} onClick={handleDownload} variant="default">
|
||||||
<IconDownload size={20} />
|
<IconDownload size={20} />
|
||||||
<Text size="sm">{t('buttons.download')}</Text>
|
<Text size="sm">{t('buttons.download')}</Text>
|
||||||
|
|||||||
@@ -9,40 +9,22 @@ export default function Credits() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Group position="center" mt="xs">
|
<Group position="center" mt="xs">
|
||||||
<Group spacing={0}>
|
<Text
|
||||||
<ActionIcon<'a'> component="a" href="https://github.com/ajnart/homarr" size="lg">
|
style={{
|
||||||
<IconBrandGithub size={18} />
|
fontSize: '0.90rem',
|
||||||
</ActionIcon>
|
textAlign: 'center',
|
||||||
<Text
|
color: 'gray',
|
||||||
style={{
|
}}
|
||||||
position: 'relative',
|
>
|
||||||
fontSize: '0.90rem',
|
{t('credits.madeWithLove')}
|
||||||
color: 'gray',
|
<Anchor
|
||||||
}}
|
href="https://github.com/ajnart"
|
||||||
|
style={{ color: 'inherit', fontStyle: 'inherit', fontSize: 'inherit' }}
|
||||||
>
|
>
|
||||||
{CURRENT_VERSION}
|
ajnart
|
||||||
</Text>
|
</Anchor>
|
||||||
</Group>
|
{' '}and you !
|
||||||
<Group spacing={1}>
|
</Text>
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
fontSize: '0.90rem',
|
|
||||||
textAlign: 'center',
|
|
||||||
color: 'gray',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t('credits.madeWithLove')}
|
|
||||||
<Anchor
|
|
||||||
href="https://github.com/ajnart"
|
|
||||||
style={{ color: 'inherit', fontStyle: 'inherit', fontSize: 'inherit' }}
|
|
||||||
>
|
|
||||||
ajnart
|
|
||||||
</Anchor>
|
|
||||||
</Text>
|
|
||||||
<ActionIcon<'a'> component="a" href="https://discord.gg/aCsmEV5RgA" size="lg">
|
|
||||||
<IconBrandDiscord size={18} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
</Group>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Button, ScrollArea, Stack } from '@mantine/core';
|
import { Button, ScrollArea, Stack } from '@mantine/core';
|
||||||
|
import { useTranslation } from 'next-i18next';
|
||||||
import { useConfigContext } from '../../../config/provider';
|
import { useConfigContext } from '../../../config/provider';
|
||||||
import { useConfigStore } from '../../../config/store';
|
import { useConfigStore } from '../../../config/store';
|
||||||
import { LayoutSelector } from './Layout/LayoutSelector';
|
import { LayoutSelector } from './Layout/LayoutSelector';
|
||||||
@@ -14,6 +15,7 @@ import { ShadeSelector } from './Theme/ShadeSelector';
|
|||||||
|
|
||||||
export default function CustomizationSettings() {
|
export default function CustomizationSettings() {
|
||||||
const { config, name: configName } = useConfigContext();
|
const { config, name: configName } = useConfigContext();
|
||||||
|
const { t } = useTranslation('common');
|
||||||
|
|
||||||
const { updateConfig } = useConfigStore();
|
const { updateConfig } = useConfigStore();
|
||||||
|
|
||||||
@@ -26,8 +28,8 @@ export default function CustomizationSettings() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack mb="md" mr="sm" mt="xs">
|
<Stack mt="xs" spacing={0}>
|
||||||
<ScrollArea style={{ height: '76vh' }} offsetScrollbars>
|
<ScrollArea style={{ height: '78vh' }} offsetScrollbars>
|
||||||
<LayoutSelector defaultLayout={config?.settings.customization.layout} />
|
<LayoutSelector defaultLayout={config?.settings.customization.layout} />
|
||||||
<PageTitleChanger defaultValue={config?.settings.customization.pageTitle} />
|
<PageTitleChanger defaultValue={config?.settings.customization.pageTitle} />
|
||||||
<MetaTitleChanger defaultValue={config?.settings.customization.metaTitle} />
|
<MetaTitleChanger defaultValue={config?.settings.customization.metaTitle} />
|
||||||
@@ -47,7 +49,9 @@ export default function CustomizationSettings() {
|
|||||||
<OpacitySelector defaultValue={config?.settings.customization.appOpacity} />
|
<OpacitySelector defaultValue={config?.settings.customization.appOpacity} />
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
|
|
||||||
<Button onClick={saveConfiguration} variant="light">Save Customizations</Button>
|
<Button onClick={saveConfiguration} variant="filled">
|
||||||
|
{t('common:save')}
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Drawer, ScrollArea, Tabs, Title } from '@mantine/core';
|
|||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
|
|
||||||
import CommonSettings from './Common/CommonSettings';
|
import CommonSettings from './Common/CommonSettings';
|
||||||
import Credits from './Common/Credits';
|
|
||||||
import CustomizationSettings from './Customization/CustomizationSettings';
|
import CustomizationSettings from './Customization/CustomizationSettings';
|
||||||
|
|
||||||
function SettingsMenu({ newVersionAvailable }: { newVersionAvailable: string }) {
|
function SettingsMenu({ newVersionAvailable }: { newVersionAvailable: string }) {
|
||||||
@@ -15,9 +14,7 @@ function SettingsMenu({ newVersionAvailable }: { newVersionAvailable: string })
|
|||||||
<Tabs.Tab value="customization">{t('tabs.customizations')}</Tabs.Tab>
|
<Tabs.Tab value="customization">{t('tabs.customizations')}</Tabs.Tab>
|
||||||
</Tabs.List>
|
</Tabs.List>
|
||||||
<Tabs.Panel data-autofocus value="common">
|
<Tabs.Panel data-autofocus value="common">
|
||||||
<ScrollArea style={{ height: '78vh' }} offsetScrollbars>
|
<CommonSettings />
|
||||||
<CommonSettings />
|
|
||||||
</ScrollArea>
|
|
||||||
</Tabs.Panel>
|
</Tabs.Panel>
|
||||||
<Tabs.Panel value="customization">
|
<Tabs.Panel value="customization">
|
||||||
<CustomizationSettings />
|
<CustomizationSettings />
|
||||||
@@ -48,7 +45,6 @@ export function SettingsDrawer({
|
|||||||
onClose={closeDrawer}
|
onClose={closeDrawer}
|
||||||
>
|
>
|
||||||
<SettingsMenu newVersionAvailable={newVersionAvailable} />
|
<SettingsMenu newVersionAvailable={newVersionAvailable} />
|
||||||
<Credits />
|
|
||||||
</Drawer>
|
</Drawer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user