umami/components/layout/Layout.js

39 lines
920 B
JavaScript
Raw Normal View History

2020-07-17 10:03:38 +02:00
import React from 'react';
2020-08-07 07:03:02 +02:00
import classNames from 'classnames';
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';
2020-08-07 07:03:02 +02:00
import styles from './Layout.module.css';
2020-07-17 10:03:38 +02:00
2020-08-07 07:03:02 +02:00
export default function Layout({
title,
children,
header = true,
footer = true,
center = false,
middle = false,
}) {
2020-07-17 10:03:38 +02:00
return (
<>
<Head>
<title>umami{title && ` - ${title}`}</title>
<link rel="icon" href="/favicon.ico" />
<link
2020-07-30 05:09:41 +02:00
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap"
2020-07-17 10:03:38 +02:00
rel="stylesheet"
/>
</Head>
2020-08-07 07:03:02 +02:00
{header && <Header />}
<main
className={classNames(styles.layout, 'container', {
[styles.center]: center,
[styles.middle]: middle,
})}
>
{children}
</main>
{footer && <Footer />}
2020-07-17 10:03:38 +02:00
</>
);
}