2022-06-26 13:43:36 +02:00
|
|
|
import Head from 'next/head'
|
2019-11-11 06:30:36 +01:00
|
|
|
import { AmpIncludeAmpInstallServiceworker } from './amp/AmpCustomElement'
|
|
|
|
|
|
|
|
// Your app's theme color
|
|
|
|
const THEME_COLOR = '#005af0'
|
|
|
|
|
2022-06-26 13:43:36 +02:00
|
|
|
type LayoutProps = {
|
|
|
|
title: string
|
|
|
|
children?: React.ReactNode
|
|
|
|
description: string
|
|
|
|
}
|
|
|
|
|
2019-11-11 06:30:36 +01:00
|
|
|
/**
|
|
|
|
* A sample page layout installing the AMP Serviceworker by default.
|
|
|
|
*/
|
2022-06-26 13:43:36 +02:00
|
|
|
const Layout: React.FC<LayoutProps> = ({ title, children, description }) => (
|
2019-11-11 06:30:36 +01:00
|
|
|
<>
|
2022-06-26 13:43:36 +02:00
|
|
|
<Head>
|
|
|
|
<title>{title || ''}</title>
|
|
|
|
<meta name="description" content={description || ''} />
|
2019-11-11 06:30:36 +01:00
|
|
|
<meta name="theme-color" content={THEME_COLOR} />
|
|
|
|
<link rel="icon" sizes="192x192" href="/static/images/icons-192.png" />
|
|
|
|
<link rel="apple-touch-icon" href="/static/images/icons-192.png" />
|
|
|
|
<link rel="icon" href="/static/favicon.ico" />
|
|
|
|
<link rel="manifest" href="/manifest.json" />
|
2022-06-26 13:43:36 +02:00
|
|
|
</Head>
|
2019-11-11 06:30:36 +01:00
|
|
|
|
2022-06-26 13:43:36 +02:00
|
|
|
{children}
|
2019-11-11 06:30:36 +01:00
|
|
|
|
|
|
|
<AmpIncludeAmpInstallServiceworker />
|
|
|
|
<amp-install-serviceworker
|
|
|
|
src="/serviceworker.js"
|
2019-11-22 00:35:43 +01:00
|
|
|
data-iframe-src="/install-serviceworker.html"
|
2019-11-11 06:30:36 +01:00
|
|
|
layout="nodisplay"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<style jsx global>{`
|
|
|
|
body {
|
|
|
|
margin: 0;
|
|
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
|
|
Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
|
|
|
'Segoe UI Symbol';
|
|
|
|
min-height: 100vh;
|
|
|
|
scroll-behavior: smooth;
|
|
|
|
text-rendering: optimizeSpeed;
|
|
|
|
line-height: 1.5;
|
|
|
|
}
|
|
|
|
`}</style>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
|
|
|
|
export default Layout
|