-
Notifications
You must be signed in to change notification settings - Fork 4
/
_app.js
59 lines (53 loc) · 1.59 KB
/
_app.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
import App, { Container } from 'next/app'
import React from 'react'
import withApolloClient from '../apollo'
import { ApolloProvider } from 'react-apollo'
import { theme } from '../components/mia-ui'
import { ThemeProvider } from 'styled-components'
import { DragDropContextProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
class MyApp extends App {
render() {
const { Component, pageProps, apolloClient } = this.props
let pageTheme = theme
if (this.props.pageProps.subdomain !== 'mia') {
pageTheme = {
...theme,
font: {
light: '"Helvetica Neue", Helvetica, san-serif',
regular: '"Helvetica Neue", Helvetica, san-serif',
bold: '"Helvetica Neue", Helvetica, san-serif',
black: '"Helvetica Neue", Helvetica, san-serif'
}
}
}
return (
<Container>
<ThemeProvider theme={pageTheme}>
<DragDropContextProvider backend={HTML5Backend}>
<ApolloProvider client={apolloClient}>
<Component {...pageProps} />
</ApolloProvider>
</DragDropContextProvider>
</ThemeProvider>
</Container>
)
}
}
// class ExportApp extends App {
// render() {
// const { Component, pageProps } = this.props
//
// return (
// <Container>
// <ThemeProvider>
// <Component {...pageProps} />
// </ThemeProvider>
// </Container>
// )
// }
// }
//
// const ExportComponent =
// process.env.EXPORT_MODE === 'export' ? ExportApp : withApolloClient(MyApp)
export default withApolloClient(MyApp)