git ssb

0+

Rômulo Alves / plainbudget-next



Tree: f20766fcd63c17fd9526329e92ea3e92f42b26ac

Files: f20766fcd63c17fd9526329e92ea3e92f42b26ac / pages / _app.js

645 bytesRaw
1import App, { Container } from 'next/app';
2import React from 'react';
3
4import { isMobile } from '../utils/mobile';
5
6export default class PlainBudgetApp extends App {
7 static async getInitialProps ({ Component, ctx }) {
8 const { req } = ctx;
9 const isMobileDevice = isMobile(req);
10
11 ctx.isMobile = isMobileDevice;
12
13 let pageProps = {};
14
15 if (Component.getInitialProps) {
16 pageProps = await Component.getInitialProps(ctx);
17 }
18
19 return { pageProps };
20 }
21
22 render () {
23 const { Component, pageProps } = this.props;
24
25 return (
26 <Container>
27 <Component { ...pageProps } />
28 </Container>
29 );
30 }
31}

Built with git-ssb-web