Files
Homarr/src/components/layout/Logo.tsx

45 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-05-15 12:42:53 +02:00
import { Group, Image, Text } from '@mantine/core';
2022-05-21 00:52:55 +02:00
import { NextLink } from '@mantine/next';
2022-04-25 00:11:32 +02:00
import * as React from 'react';
import { useColorTheme } from '../../tools/color';
2022-06-07 00:07:56 +00:00
import { useConfig } from '../../tools/state';
2022-04-25 00:11:32 +02:00
export function Logo({ style, withoutText }: any) {
2022-06-07 00:07:56 +00:00
const { config } = useConfig();
const { primaryColor, secondaryColor } = useColorTheme();
2022-06-07 00:07:56 +00:00
2022-05-12 14:24:15 +02:00
return (
<Group spacing="xs">
2022-05-15 12:42:53 +02:00
<Image
width={50}
src={config.settings.logo || '/imgs/logo.png'}
2022-05-15 12:42:53 +02:00
style={{
position: 'relative',
}}
/>
{withoutText ? null : (
<NextLink
href="/"
style={{
textDecoration: 'none',
position: 'relative',
}}
2022-05-21 00:52:55 +02:00
>
<Text
sx={style}
weight="bold"
variant="gradient"
gradient={{
from: primaryColor,
to: secondaryColor,
deg: 145,
}}
>
{config.settings.title || 'Homarr'}
</Text>
</NextLink>
)}
</Group>
2022-05-12 14:24:15 +02:00
);
2022-04-25 00:11:32 +02:00
}