File tree Expand file tree Collapse file tree 5 files changed +184
-6
lines changed
Expand file tree Collapse file tree 5 files changed +184
-6
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+
3+ import { Grid , Link , Typography , withStyles } from '@material-ui/core' ;
4+
5+ import { Error as ErrorLayout } from '../layouts' ;
6+
7+ const Forbidden = ( { classes } ) => (
8+ < ErrorLayout >
9+ < Grid item >
10+ < Typography variant = "h1" color = "textPrimary" >
11+ 403
12+ </ Typography >
13+ </ Grid >
14+
15+ < Grid item >
16+ < Typography variant = "h6" color = "textSecondary" >
17+ You shouldn't be here!
18+ </ Typography >
19+ </ Grid >
20+
21+ < Grid className = { classes . break } item />
22+
23+ < Grid item >
24+ < Typography align = "center" color = "textSecondary" >
25+ You are not allowed to visit this page. Contact your < br />
26+ administrator for more information
27+ </ Typography >
28+ </ Grid >
29+
30+ < Grid className = { classes . spacer } item />
31+
32+ < Grid item >
33+ < Link href = { null } > Contact Administrator</ Link >
34+ </ Grid >
35+
36+ < Grid item >
37+ < Link href = "#" > Go Home</ Link >
38+ </ Grid >
39+ </ ErrorLayout >
40+ ) ;
41+
42+ const styles = theme => ( {
43+ spacer : {
44+ height : theme . spacing . unit * 4 ,
45+ } ,
46+
47+ break : {
48+ height : theme . spacing . unit * 2 ,
49+ } ,
50+ } ) ;
51+
52+ export default withStyles ( styles ) ( Forbidden ) ;
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+
3+ import { Grid , Link , Typography , withStyles } from '@material-ui/core' ;
4+
5+ import { Error as ErrorLayout } from '../layouts' ;
6+
7+ const InternalServer = ( { classes } ) => (
8+ < ErrorLayout >
9+ < Grid item >
10+ < Typography variant = "h1" color = "textPrimary" >
11+ 500
12+ </ Typography >
13+ </ Grid >
14+
15+ < Grid item >
16+ < Typography variant = "h6" color = "textSecondary" >
17+ Well, you broke the internet!
18+ </ Typography >
19+ </ Grid >
20+
21+ < Grid className = { classes . break } item />
22+
23+ < Grid item >
24+ < Typography align = "center" color = "textSecondary" >
25+ Just kidding, looks like we have an internal issue,
26+ < br />
27+ please try again in couple minutes
28+ </ Typography >
29+ </ Grid >
30+
31+ < Grid className = { classes . spacer } item />
32+
33+ < Grid item >
34+ < Link href = { null } > Report Problem</ Link >
35+ </ Grid >
36+ </ ErrorLayout >
37+ ) ;
38+
39+ const styles = theme => ( {
40+ spacer : {
41+ height : theme . spacing . unit * 4 ,
42+ } ,
43+
44+ break : {
45+ height : theme . spacing . unit * 2 ,
46+ } ,
47+ } ) ;
48+
49+ export default withStyles ( styles ) ( InternalServer ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
22
3+ import {
4+ Grid ,
5+ IconButton ,
6+ InputBase ,
7+ Link ,
8+ Paper ,
9+ Typography ,
10+ withStyles ,
11+ } from '@material-ui/core' ;
12+
13+ import { Search as SearchIcon } from '@material-ui/icons' ;
14+
315import { Error as ErrorLayout } from '../layouts' ;
416
5- const NotFound = ( ) => (
17+ let Search = ( { classes } ) => (
18+ < Paper className = { classes . root } elevation = { 1 } >
19+ < IconButton >
20+ < SearchIcon />
21+ </ IconButton >
22+
23+ < InputBase
24+ className = { classes . input }
25+ placeholder = "Search for anything"
26+ />
27+ </ Paper >
28+ ) ;
29+
30+ const searchStyles = theme => ( {
31+ root : {
32+ padding : '8px 12px' ,
33+ display : 'flex' ,
34+ alignItems : 'center' ,
35+ width : 400 ,
36+ } ,
37+
38+ input : {
39+ marginLeft : 8 ,
40+ flex : 1 ,
41+ } ,
42+ } ) ;
43+
44+ Search = withStyles ( searchStyles ) ( Search ) ;
45+
46+ const NotFound = ( { classes } ) => (
647 < ErrorLayout >
7- < h1 > Whooops! We couldn't find what you're looking for :(</ h1 >
48+ < Grid item >
49+ < Typography variant = "h1" color = "textPrimary" >
50+ 404
51+ </ Typography >
52+ </ Grid >
53+
54+ < Grid item >
55+ < Typography variant = "h6" color = "textSecondary" >
56+ Sorry but we could not find the page you are looking for
57+ </ Typography >
58+ </ Grid >
59+
60+ < Grid className = { classes . spacer } item />
61+
62+ < Grid item >
63+ < Search />
64+ </ Grid >
65+
66+ < Grid className = { classes . break } item />
67+
68+ < Grid item >
69+ < Link href = "#" > Go Home</ Link >
70+ </ Grid >
871 </ ErrorLayout >
972) ;
1073
11- export default NotFound ;
74+ const styles = theme => ( {
75+ spacer : {
76+ height : theme . spacing . unit * 4 ,
77+ } ,
78+
79+ break : {
80+ height : theme . spacing . unit * 2 ,
81+ } ,
82+ } ) ;
83+
84+ export default withStyles ( styles ) ( NotFound ) ;
Original file line number Diff line number Diff line change 11import loadable from '@loadable/component' ;
22
3+ export const Forbidden = loadable ( ( ) => import ( './Forbidden' ) ) ;
4+ export const InternalServer = loadable ( ( ) => import ( './InternalServer' ) ) ;
35export const NotFound = loadable ( ( ) => import ( './NotFound' ) ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { withStyles , Grid } from '@material-ui/core' ;
33
4- const Error = props => (
4+ const Error = ( { classes , children } ) => (
55 < Grid
6+ className = { classes . root }
67 container
8+ direction = "column"
79 justify = "center"
810 alignItems = "center"
9- className = { props . classes . root }
11+ spacing = { 4 }
1012 >
11- < Grid item > { props . children } </ Grid >
13+ { children }
1214 </ Grid >
1315) ;
1416
You can’t perform that action at this time.
0 commit comments