umami/components/layout/Layout.js

28 lines
734 B
JavaScript
Raw Normal View History

2020-07-17 10:03:38 +02:00
import React from 'react';
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-13 08:15:37 +02:00
import { useIntl } from 'react-intl';
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-05-13 08:15:37 +02:00
const intl = useIntl();
2020-07-17 10:03:38 +02:00
return (
<>
2021-05-13 08:15:37 +02:00
<Head dir={intl.formatMessage({ id: 'metrics.dir', defaultMessage: 'ltr' })}>
2020-07-17 10:03:38 +02:00
<title>umami{title && ` - ${title}`}</title>
</Head>
2021-05-13 08:15:37 +02:00
2020-08-07 07:03:02 +02:00
{header && <Header />}
2021-05-13 08:15:37 +02:00
<main
className="container"
dir={intl.formatMessage({ id: 'metrics.dir', defaultMessage: 'ltr' })}
>
{children}
</main>
2020-08-07 07:03:02 +02:00
{footer && <Footer />}
2020-09-20 10:33:39 +02:00
<div id="__modals" />
2020-07-17 10:03:38 +02:00
</>
);
}