Added a background image input

Added an input in the advanced options for a background image. Also removed an unused import from my previous commit and changed the margin on the header bar to padding instead.
This commit is contained in:
Aimsucks
2022-06-07 17:36:05 +00:00
parent 901798055b
commit 423f8110b9
7 changed files with 33 additions and 3 deletions

View File

@@ -28,6 +28,7 @@ export default function Aside(props: any) {
className={cx(classes.hide)}
style={{
border: 'none',
background: 'none',
}}
width={{
base: 'auto',

View File

@@ -0,0 +1,19 @@
import { Global } from '@mantine/core';
import { useConfig } from '../../tools/state';
export function Background() {
const { config } = useConfig();
return (
<Global
styles={{
body: {
backgroundImage: `url('${config.settings.background}')` || '',
backgroundPosition: 'center',
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat',
},
}}
/>
);
}

View File

@@ -41,7 +41,7 @@ export function Header(props: any) {
return (
<Head height="auto">
<Group m="xs" position="apart">
<Group p="xs" position="apart">
<Box className={classes.hide}>
<Logo style={{ fontSize: 22 }} />
</Box>

View File

@@ -3,6 +3,7 @@ import { Header } from './Header';
import { Footer } from './Footer';
import Aside from './Aside';
import { HeaderConfig } from './HeaderConfig';
import { Background } from './Background';
const useStyles = createStyles((theme) => ({
main: {},
@@ -13,6 +14,7 @@ export default function Layout({ children, style }: any) {
return (
<AppShell aside={<Aside />} header={<Header />} footer={<Footer links={[]} />}>
<HeaderConfig />
<Background />
<main
className={cx(classes.main)}
style={{