Files: d43e73c547b54ad1b9f250da0e06562553fdd203 / pages / _app.js
743 bytesRaw
1 | import App, { Container } from 'next/app'; |
2 | import Head from 'next/head'; |
3 | import React from 'react'; |
4 | |
5 | import { isMobile } from '../utils/mobile'; |
6 | |
7 | export default class PlainBudgetApp extends App { |
8 | static async getInitialProps ({ Component, ctx }) { |
9 | const { req } = ctx; |
10 | const isMobileDevice = isMobile(req); |
11 | |
12 | ctx.isMobile = isMobileDevice; |
13 | |
14 | let pageProps = {}; |
15 | |
16 | if (Component.getInitialProps) { |
17 | pageProps = await Component.getInitialProps(ctx); |
18 | } |
19 | |
20 | return { pageProps }; |
21 | } |
22 | |
23 | render () { |
24 | const { Component, pageProps } = this.props; |
25 | |
26 | return ( |
27 | <Container> |
28 | <Head> |
29 | <title>plainbudget</title> |
30 | </Head> |
31 | <Component { ...pageProps } /> |
32 | </Container> |
33 | ); |
34 | } |
35 | } |
Built with git-ssb-web