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

26 lines
587 B
TypeScript
Raw Normal View History

import { Global } from '@mantine/core';
2023-07-21 18:08:40 +09:00
2022-12-04 17:36:30 +01:00
import { useConfigContext } from '../../config/provider';
export function Background() {
2022-12-04 17:36:30 +01:00
const { config } = useConfigContext();
2023-07-30 01:09:10 +02:00
if (!config?.settings.customization.backgroundImageUrl) {
return null;
}
return (
<Global
styles={{
body: {
minHeight: '100vh',
2023-07-30 01:09:10 +02:00
backgroundImage: `url('${config?.settings.customization.backgroundImageUrl}')`,
backgroundPosition: 'center center',
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat',
},
}}
/>
);
}