1
1
import React from 'react'
2
- import { css , StyleSheet } from 'next/css'
2
+ import { style , merge } from 'next/css'
3
3
4
4
export default class Error extends React . Component {
5
5
static getInitialProps ( { res, xhr } ) {
@@ -11,19 +11,19 @@ export default class Error extends React.Component {
11
11
const { statusCode } = this . props
12
12
const title = statusCode === 404 ? 'This page could not be found' : 'Internal Server Error'
13
13
14
- return < div className = { css ( styles . error , styles [ 'error_' + statusCode ] ) } >
15
- < div className = { css ( styles . text ) } >
16
- < h1 className = { css ( styles . h1 ) } > { statusCode } </ h1 >
17
- < div className = { css ( styles . desc ) } >
18
- < h2 className = { css ( styles . h2 ) } > { title } .</ h2 >
14
+ return < div className = { merge ( styles . error , styles [ 'error_' + statusCode ] ) } >
15
+ < div className = { styles . text } >
16
+ < h1 className = { styles . h1 } > { statusCode } </ h1 >
17
+ < div className = { styles . desc } >
18
+ < h2 className = { styles . h2 } > { title } .</ h2 >
19
19
</ div >
20
20
</ div >
21
21
</ div >
22
22
}
23
23
}
24
24
25
- const styles = StyleSheet . create ( {
26
- error : {
25
+ const styles = {
26
+ error : style ( {
27
27
color : '#000' ,
28
28
background : '#fff' ,
29
29
top : 0 ,
@@ -34,17 +34,17 @@ const styles = StyleSheet.create({
34
34
fontFamily : '"SF UI Text", "Helvetica Neue", "Lucida Grande"' ,
35
35
textAlign : 'center' ,
36
36
paddingTop : '20%'
37
- } ,
37
+ } ) ,
38
38
39
- desc : {
39
+ desc : style ( {
40
40
display : 'inline-block' ,
41
41
textAlign : 'left' ,
42
42
lineHeight : '49px' ,
43
43
height : '49px' ,
44
44
verticalAlign : 'middle'
45
- } ,
45
+ } ) ,
46
46
47
- h1 : {
47
+ h1 : style ( {
48
48
display : 'inline-block' ,
49
49
borderRight : '1px solid rgba(0, 0, 0,.3)' ,
50
50
margin : 0 ,
@@ -53,12 +53,12 @@ const styles = StyleSheet.create({
53
53
fontSize : '24px' ,
54
54
fontWeight : 500 ,
55
55
verticalAlign : 'top'
56
- } ,
56
+ } ) ,
57
57
58
- h2 : {
58
+ h2 : style ( {
59
59
fontSize : '14px' ,
60
60
fontWeight : 'normal' ,
61
61
margin : 0 ,
62
62
padding : 0
63
- }
64
- } )
63
+ } )
64
+ }
0 commit comments