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';
|
2022-06-08 14:58:32 +00:00
|
|
|
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
|
|
|
|
2022-07-22 13:18:03 +02:00
|
|
|
export function Logo({ style, withoutText }: any) {
|
2022-06-07 00:07:56 +00:00
|
|
|
const { config } = useConfig();
|
2022-06-08 14:58:32 +00:00
|
|
|
const { primaryColor, secondaryColor } = useColorTheme();
|
2022-06-07 00:07:56 +00:00
|
|
|
|
2022-05-12 14:24:15 +02:00
|
|
|
return (
|
2022-05-17 01:01:26 +02:00
|
|
|
<Group spacing="xs">
|
2022-05-15 12:42:53 +02:00
|
|
|
<Image
|
|
|
|
|
width={50}
|
2022-06-07 01:35:50 +00:00
|
|
|
src={config.settings.logo || '/imgs/logo.png'}
|
2022-05-15 12:42:53 +02:00
|
|
|
style={{
|
|
|
|
|
position: 'relative',
|
|
|
|
|
}}
|
|
|
|
|
/>
|
2022-07-22 13:18:03 +02:00
|
|
|
{withoutText ? null : (
|
|
|
|
|
<NextLink
|
|
|
|
|
href="/"
|
|
|
|
|
style={{
|
|
|
|
|
textDecoration: 'none',
|
|
|
|
|
position: 'relative',
|
2022-06-07 16:53:51 +00:00
|
|
|
}}
|
2022-05-21 00:52:55 +02:00
|
|
|
>
|
2022-07-22 13:18:03 +02:00
|
|
|
<Text
|
|
|
|
|
sx={style}
|
|
|
|
|
weight="bold"
|
|
|
|
|
variant="gradient"
|
|
|
|
|
gradient={{
|
|
|
|
|
from: primaryColor,
|
|
|
|
|
to: secondaryColor,
|
|
|
|
|
deg: 145,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{config.settings.title || 'Homarr'}
|
|
|
|
|
</Text>
|
|
|
|
|
</NextLink>
|
|
|
|
|
)}
|
2022-05-14 21:41:30 +02:00
|
|
|
</Group>
|
2022-05-12 14:24:15 +02:00
|
|
|
);
|
2022-04-25 00:11:32 +02:00
|
|
|
}
|