File tree Expand file tree Collapse file tree 5 files changed +37
-14
lines changed Expand file tree Collapse file tree 5 files changed +37
-14
lines changed Original file line number Diff line number Diff line change 5
5
"dependencies" : {
6
6
"@material-ui/core" : " ^4.0.0-rc.0" ,
7
7
"@material-ui/icons" : " ^4.0.0-rc.0" ,
8
- "@types/jest" : " 24.0.13" ,
9
- "@types/node" : " 12.0.2" ,
10
- "@types/react" : " 16.8.18" ,
11
- "@types/react-dom" : " 16.8.4" ,
12
- "@types/react-router-dom" : " ^4.3.3" ,
13
8
"apollo-cache-inmemory" : " ^1.6.0" ,
14
9
"apollo-client" : " ^2.6.0" ,
15
10
"apollo-link" : " ^1.2.11" ,
53
48
]
54
49
},
55
50
"devDependencies" : {
56
- "@types/lodash.get" : " ^4.4.6"
51
+ "@types/lodash.get" : " ^4.4.6" ,
52
+ "@types/jest" : " 24.0.13" ,
53
+ "@types/node" : " 12.0.2" ,
54
+ "@types/react" : " 16.8.18" ,
55
+ "@types/react-dom" : " 16.8.4" ,
56
+ "@types/react-router-dom" : " ^4.3.3"
57
57
}
58
58
}
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
+ import { Redirect } from 'react-router'
2
3
3
4
const NotFound : React . FC = ( props ) => {
4
- return < div > NotFound</ div >
5
+ if ( ! localStorage . getItem ( 'token' ) ) return < Redirect to = "/login" />
6
+
7
+ return < div > Not Found</ div >
5
8
}
6
9
7
10
export default NotFound
Original file line number Diff line number Diff line change @@ -119,13 +119,23 @@ const Login: React.FC<Props> = () => {
119
119
value = { values . password }
120
120
/>
121
121
{ errors . password && touched . password && errors . password }
122
- < Button type = "submit" disabled = { isSubmitting } >
123
- Submit
124
- </ Button >
122
+ < Box clone my = { 2 } >
123
+ < Button
124
+ variant = "contained"
125
+ color = "primary"
126
+ type = "submit"
127
+ disabled = { isSubmitting }
128
+ >
129
+ Submit
130
+ </ Button >
131
+ </ Box >
125
132
</ form >
126
133
</ Box >
127
134
) }
128
135
</ Formik >
136
+ < Box display = "flex" flexDirection = "column" alignItems = "flex-end" >
137
+ < Button onClick = { ( ) => history . push ( '/signup' ) } > Signup</ Button >
138
+ </ Box >
129
139
{ error }
130
140
</ Paper >
131
141
</ Box >
Original file line number Diff line number Diff line change @@ -134,13 +134,23 @@ const Signup: React.FC<Props> = () => {
134
134
value = { values . password }
135
135
/>
136
136
{ errors . password && touched . password && errors . password }
137
- < Button type = "submit" disabled = { isSubmitting } >
138
- Submit
139
- </ Button >
137
+ < Box clone my = { 2 } >
138
+ < Button
139
+ variant = "contained"
140
+ color = "primary"
141
+ type = "submit"
142
+ disabled = { isSubmitting }
143
+ >
144
+ Submit
145
+ </ Button >
146
+ </ Box >
140
147
</ form >
141
148
</ Box >
142
149
) }
143
150
</ Formik >
151
+ < Box display = "flex" flexDirection = "column" alignItems = "flex-end" >
152
+ < Button onClick = { ( ) => history . push ( '/login' ) } > Login</ Button >
153
+ </ Box >
144
154
{ error }
145
155
</ Paper >
146
156
</ Box >
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ const AuthLayout: React.FC<Props> = ({ children }) => {
56
56
useEffect ( ( ) => {
57
57
window . addEventListener ( 'resize' , resize )
58
58
resize ( )
59
- } , [ resize ] )
59
+ } , [ ] ) // eslint-disable-line
60
60
61
61
const checkIsMobile = ( ) => ( window . innerWidth < 600 ? true : false )
62
62
You can’t perform that action at this time.
0 commit comments