forked from sportstimes/f1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Layout.js
65 lines (55 loc) · 2.66 KB
/
Layout.js
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
import Head from 'next/head';
import React from 'react';
import Header from '../components/Header';
import Footer from '../components/Footer';
import CookieConsent from "react-cookie-consent";
import styles from './Layout.module.scss'
import useTranslation from 'next-translate/useTranslation'
const Layout = props => {
const {t, lang} = useTranslation()
function setGoogleTags() {
return {
__html: `(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-91583-25', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');`
};
}
return (
<div className={styles.content}>
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5"/>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>
<link rel="manifest" href="/site.webmanifest"/>
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#eb000f"/>
<link rel="preload" as="script" href="//www.google-analytics.com/analytics.js"/>
<meta name="msapplication-TileColor" content="#000000"/>
<meta name="theme-color" content="#ffffff"/>
<meta name="google-site-verification" content="tMVNkyoK26Mb76mN4Fka9NrVjh214rH-2Usv7ktKfSU" />
<script dangerouslySetInnerHTML={setGoogleTags()}/>
</Head>
<noscript>
<div className="noscript">{t('common:javascript')}</div>
</noscript>
<Header showCTABar={props.showCTABar} year={props.year}/>
<div className={styles.main_content}>{props.children}</div>
<Footer/>
<CookieConsent
location="bottom"
buttonText={t('common:cookies.button')}
cookieName="f1cal"
style={{background: "#0E5143", zIndex: 999999, padding: "5px 0"}}
buttonStyle={{color: "#000000", background: "#ffffff", fontSize: "13px"}}
expires={150}
>
{t('common:cookies.title')}
</CookieConsent>
</div>
);
};
export default Layout;