Files: b17cf440c9dbf4e1f387500422eac5a7b137232e / components / page.js
1935 bytesRaw
1 | import Head from 'next/head'; |
2 | import Router from 'next/router'; |
3 | import NProgress from 'nprogress'; |
4 | import { |
5 | node, |
6 | string |
7 | } from 'prop-types'; |
8 | |
9 | Router.onRouteChangeStart = () => NProgress.start(); |
10 | Router.onRouteChangeComplete = () => NProgress.done(); |
11 | Router.onRouteChangeError = () => NProgress.done(); |
12 | |
13 | const Page = ({ children, pageTitle }) => ( |
14 | <div> |
15 | <Head> |
16 | <meta charSet="utf-8" /> |
17 | <meta httpEquiv="X-UA-Compatible" content="IE=edge" /> |
18 | <meta name="description" content="@romuloalves - Software Developer" /> |
19 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
20 | <link rel="icon" type="image/png" href="/static/favicon.png" /> |
21 | <link rel="manifest" href="/static/manifest.json" /> |
22 | <title> |
23 | { `@romuloalves${pageTitle ? ` – ${pageTitle}` : ''}` } |
24 | </title> |
25 | </Head> |
26 | { children } |
27 | |
28 | <style jsx>{` |
29 | h2 { |
30 | font-size: 22pt; |
31 | } |
32 | `}</style> |
33 | |
34 | <style jsx global>{` |
35 | * { |
36 | border: none; |
37 | margin: 0; |
38 | padding: 0; |
39 | } |
40 | |
41 | body { |
42 | font-family: Menlo, Monaco, Consolas; |
43 | } |
44 | |
45 | a { |
46 | color: #000; |
47 | } |
48 | a:hover { |
49 | color: #81D4FA; |
50 | } |
51 | |
52 | /* loading progress bar styles */ |
53 | #nprogress { |
54 | pointer-events: none; |
55 | } |
56 | #nprogress .bar { |
57 | background: #22BAD9; |
58 | position: fixed; |
59 | z-index: 1031; |
60 | top: 0; |
61 | left: 0; |
62 | width: 100%; |
63 | height: 2px; |
64 | } |
65 | #nprogress .peg { |
66 | display: block; |
67 | position: absolute; |
68 | right: 0px; |
69 | width: 100px; |
70 | height: 100%; |
71 | box-shadow: 0 0 10px #22BAD9, 0 0 5px #22BAD9; |
72 | opacity: 1.0; |
73 | transform: rotate(3deg) translate(0px, -4px); |
74 | } |
75 | `}</style> |
76 | </div> |
77 | ); |
78 | |
79 | Page.propTypes = { |
80 | children: node.isRequired, |
81 | pageTitle: string |
82 | }; |
83 | |
84 | Page.defaultProps = { |
85 | pageTitle: '' |
86 | }; |
87 | |
88 | export default Page; |
Built with git-ssb-web