2022-05-15 12:42:53 +02:00
|
|
|
import { Group, Image, Text } from '@mantine/core';
|
2022-12-04 17:36:30 +01:00
|
|
|
import { useConfigContext } from '../../config/provider';
|
2022-12-04 18:45:14 +01:00
|
|
|
import { usePrimaryGradient } from './useGradient';
|
2022-04-25 00:11:32 +02:00
|
|
|
|
2022-12-04 17:36:30 +01:00
|
|
|
interface LogoProps {
|
|
|
|
|
size?: 'md' | 'xs';
|
|
|
|
|
withoutText?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function Logo({ size = 'md', withoutText = false }: LogoProps) {
|
|
|
|
|
const { config } = useConfigContext();
|
2022-12-04 18:45:14 +01:00
|
|
|
const primaryGradient = usePrimaryGradient();
|
2022-06-07 00:07:56 +00:00
|
|
|
|
2022-05-12 14:24:15 +02:00
|
|
|
return (
|
2022-12-04 17:36:30 +01:00
|
|
|
<Group spacing={size === 'md' ? 'xs' : 4} noWrap>
|
2022-05-15 12:42:53 +02:00
|
|
|
<Image
|
2022-12-06 21:33:12 +01:00
|
|
|
width={size === 'md' ? 50 : 12}
|
2022-12-04 17:36:30 +01:00
|
|
|
src={config?.settings.customization.logoImageUrl || '/imgs/logo/logo.png'}
|
2022-05-15 12:42:53 +02:00
|
|
|
style={{
|
|
|
|
|
position: 'relative',
|
|
|
|
|
}}
|
|
|
|
|
/>
|
2022-07-22 13:18:03 +02:00
|
|
|
{withoutText ? null : (
|
2022-11-22 11:23:01 +09:00
|
|
|
<Text
|
2022-12-06 21:33:12 +01:00
|
|
|
size={size === 'md' ? 22 : 10}
|
2022-11-22 11:23:01 +09:00
|
|
|
weight="bold"
|
|
|
|
|
variant="gradient"
|
2022-12-04 18:45:14 +01:00
|
|
|
gradient={primaryGradient}
|
2022-05-21 00:52:55 +02:00
|
|
|
>
|
2022-12-04 17:36:30 +01:00
|
|
|
{config?.settings.customization.pageTitle || 'Homarr'}
|
2022-11-22 11:23:01 +09:00
|
|
|
</Text>
|
2022-07-22 13:18:03 +02:00
|
|
|
)}
|
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
|
|
|
}
|