2022-06-07 00:30:42 +02:00
|
|
|
import { AppShell, createStyles } from '@mantine/core';
|
2022-10-10 20:46:22 +02:00
|
|
|
import { Header } from './header/Header';
|
2022-04-25 00:11:32 +02:00
|
|
|
import { Footer } from './Footer';
|
2022-05-10 18:58:21 +02:00
|
|
|
import Aside from './Aside';
|
2022-06-12 08:04:20 +02:00
|
|
|
import Navbar from './Navbar';
|
2022-10-10 20:46:22 +02:00
|
|
|
import { HeaderConfig } from './header/HeaderConfig';
|
2022-06-07 17:36:05 +00:00
|
|
|
import { Background } from './Background';
|
2022-06-12 08:04:20 +02:00
|
|
|
import { useConfig } from '../../tools/state';
|
2022-04-25 00:11:32 +02:00
|
|
|
|
|
|
|
|
const useStyles = createStyles((theme) => ({
|
2022-05-16 13:54:29 +02:00
|
|
|
main: {},
|
2022-10-10 20:46:22 +02:00
|
|
|
appShell: {
|
|
|
|
|
// eslint-disable-next-line no-useless-computed-key
|
|
|
|
|
['@media screen and (display-mode: standalone)']: {
|
|
|
|
|
'&': {
|
|
|
|
|
paddingTop: '88px !important',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2022-04-25 00:11:32 +02:00
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
export default function Layout({ children, style }: any) {
|
|
|
|
|
const { classes, cx } = useStyles();
|
2022-06-12 08:04:20 +02:00
|
|
|
const { config } = useConfig();
|
|
|
|
|
const widgetPosition = config?.settings?.widgetPosition === 'left';
|
|
|
|
|
|
2022-04-25 00:11:32 +02:00
|
|
|
return (
|
2022-06-12 08:04:20 +02:00
|
|
|
<AppShell
|
2022-07-26 00:51:55 +02:00
|
|
|
fixed={false}
|
2022-06-12 08:04:20 +02:00
|
|
|
header={<Header />}
|
2022-07-22 13:18:29 +02:00
|
|
|
navbar={widgetPosition ? <Navbar /> : undefined}
|
|
|
|
|
aside={widgetPosition ? undefined : <Aside />}
|
2022-06-12 08:04:20 +02:00
|
|
|
footer={<Footer links={[]} />}
|
|
|
|
|
>
|
2022-06-07 01:35:50 +00:00
|
|
|
<HeaderConfig />
|
2022-06-07 17:36:05 +00:00
|
|
|
<Background />
|
2022-05-16 13:54:29 +02:00
|
|
|
<main
|
|
|
|
|
className={cx(classes.main)}
|
|
|
|
|
style={{
|
|
|
|
|
...style,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</main>
|
2022-08-24 00:38:10 +02:00
|
|
|
<style>
|
|
|
|
|
{cx(config.settings.customCSS)}
|
|
|
|
|
</style>
|
2022-04-25 00:11:32 +02:00
|
|
|
</AppShell>
|
|
|
|
|
);
|
|
|
|
|
}
|