-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathLayout.tsx
72 lines (66 loc) · 2.14 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import React from 'react';
import Head from 'next/head';
import Container from './Container';
import Footer from './Footer';
import Nav from './Nav';
import styles from '@styles/Home.module.css';
type LayoutProps = {
children?: React.ReactNode;
title?: string;
};
const Layout: React.FC<LayoutProps> = ({
title = 'Antoine Ordonez',
children,
}) => {
const [isOpen, setIsOpen] = React.useState(false);
return (
<div className={styles.container}>
<Head>
<title>{title}</title>
<link rel="icon" href="/favicon.ico" />
<meta charSet="utf-8" />
<meta name="author" content="Antoine Ordonez" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="Antoine Ordonez" />
<meta
property="og:description"
content="I'm a Full Stack developer with experience in DevOps, Backend, Frontend and mobile development."
/>
<meta property="og:type" content="website" />
<meta property="twitter:site" content="@_shellbear" />
<meta name="twitter:card" content="summary_large_image" />
<meta
property="og:image"
content="https://shellbear.me/img/preview.png"
/>
{process.env.NODE_ENV === 'production' && (
<>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-RZP6RWZ32F"
/>
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-RZP6RWZ32F');`,
}}
/>
</>
)}
</Head>
<Nav
isOpen={isOpen}
onOpen={() => setIsOpen(true)}
onClose={() => setIsOpen(false)}
/>
<Container justifyContent="space-between" alignContent="space-between">
{!isOpen && <main className={styles.main}>{children}</main>}
<Footer />
</Container>
</div>
);
};
export default Layout;