umami/components/layout/Layout.js

21 lines
589 B
JavaScript
Raw Normal View History

import { Container } from 'react-basics';
2020-07-17 10:03:38 +02:00
import Head from 'next/head';
2020-08-07 11:27:12 +02:00
import Header from 'components/layout/Header';
import Footer from 'components/layout/Footer';
2021-05-15 10:29:39 +02:00
import useLocale from 'hooks/useLocale';
2020-07-17 10:03:38 +02:00
2020-08-18 02:23:46 +02:00
export default function Layout({ title, children, header = true, footer = true }) {
2021-11-05 01:09:03 +01:00
const { dir } = useLocale();
2021-05-13 08:15:37 +02:00
2020-07-17 10:03:38 +02:00
return (
<Container dir={dir} style={{ maxWidth: 1140 }}>
2021-05-15 10:29:39 +02:00
<Head>
<title>{title ? `${title} | umami` : 'umami'}</title>
2020-07-17 10:03:38 +02:00
</Head>
2020-08-07 07:03:02 +02:00
{header && <Header />}
2022-03-12 01:04:05 +01:00
<main>{children}</main>
2020-08-07 07:03:02 +02:00
{footer && <Footer />}
</Container>
2020-07-17 10:03:38 +02:00
);
}