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

38 lines
1.0 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';
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 }: any) {
2022-06-07 00:07:56 +00:00
const { config } = useConfig();
2022-05-12 14:24:15 +02:00
return (
<Group spacing="xs">
2022-05-15 12:42:53 +02:00
<Image
width={50}
2022-06-07 00:07:56 +00:00
src={config.logo ?? "/imgs/logo.png"}
2022-05-15 12:42:53 +02:00
style={{
position: 'relative',
}}
/>
2022-05-21 00:52:55 +02:00
<NextLink
2022-06-01 19:53:57 +02:00
href="/"
2022-05-21 00:52:55 +02:00
style={{
textDecoration: 'none',
position: 'relative',
}}
>
2022-05-21 00:52:55 +02:00
<Text
sx={style}
weight="bold"
variant="gradient"
gradient={{ from: 'red', to: 'orange', deg: 145 }}
>
2022-06-07 00:07:56 +00:00
{/* Added the .replace to remove emojis because they get screwed up by the gradient */}
{config.title.replace(/([\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g, '') ?? "Homarr"}
2022-05-21 00:52:55 +02:00
</Text>
</NextLink>
</Group>
2022-05-12 14:24:15 +02:00
);
2022-04-25 00:11:32 +02:00
}