/
Layout.tsx
50 lines (45 loc) · 1.24 KB
/
Layout.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React from "react";
import { ThemeProvider } from "@kiwicom/orbit-components";
import styled from "styled-components";
import { WindowLocation } from "@reach/router";
import theme from "../theme";
import BaseStyles from "./BaseStyles";
import Navbar from "./Navbar";
import Footer from "./Footer";
import Head from "./Head";
import { CONTENT_PADDING } from "../consts";
const StyledWrapper = styled.div`
display: grid;
position: relative;
grid-template-rows: auto 1fr auto;
grid-template-columns: 100%;
min-height: 100vh;
`;
const StyledMain = styled.main`
display: flex;
flex-direction: column;
padding: ${CONTENT_PADDING};
`;
interface Props {
children: React.ReactNode;
location: WindowLocation;
title: string;
description?: string;
path: string;
isHome?: boolean;
}
export default function Layout({ children, location, title, description, path, isHome }: Props) {
return (
<>
<Head title={title} hasSiteName={!isHome} description={description} path={path} />
<ThemeProvider theme={theme}>
<StyledWrapper>
<BaseStyles />
<Navbar location={location} />
<StyledMain>{children}</StyledMain>
<Footer />
</StyledWrapper>
</ThemeProvider>
</>
);
}