Skip to content

Commit 6d67b7f

Browse files
committed
Remove unused modules
Convert to typescript Auth module
1 parent 1cf073a commit 6d67b7f

File tree

23 files changed

+48
-27
lines changed

23 files changed

+48
-27
lines changed

src/Auth/Auth.js renamed to src/Auth/Auth.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { Route, Redirect } from 'react-router-dom' //
2+
import { Route, Redirect, match as Match } from 'react-router-dom' //
33
import { makeStyles } from '@material-ui/core/styles'
44

55
import { Grid, Typography, Link, Box } from '@material-ui/core/'
@@ -10,7 +10,7 @@ import Signup from './Signup'
1010
import Recover from './Recover'
1111
import Reset from './Reset'
1212

13-
function Footer() {
13+
const AuthFooter = () => {
1414
return (
1515
<Typography variant="body2" color="textSecondary" align="center">
1616
<Link color="inherit" component={RouterLink} to="/">
@@ -20,7 +20,11 @@ function Footer() {
2020
)
2121
}
2222

23-
export default function Auth({ match }) {
23+
export type AuthProps = {
24+
match: Match
25+
}
26+
27+
const Auth: React.FC<AuthProps> = ({ match }) => {
2428
const classes = useStyles()
2529

2630
return (
@@ -33,7 +37,7 @@ export default function Auth({ match }) {
3337
<Route path={`${match.path}/recover`} component={Recover} />
3438
<Route path={`${match.path}/reset`} component={Reset} />
3539
<Box mt={8}>
36-
<Footer />
40+
<AuthFooter />
3741
</Box>
3842
</Box>
3943
</Grid>
@@ -64,3 +68,5 @@ const useStyles = makeStyles((theme) => ({
6468
},
6569
},
6670
}))
71+
72+
export default Auth

src/Auth/Login/Login.js renamed to src/Auth/Login/Login.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Link as RouterLink } from 'react-router-dom'
1313
import AuthHeader from '../_common/AuthHeader'
1414
import AuthContent from '../_common/AuthContent'
1515

16-
export default function Login() {
16+
const Login: React.FC = () => {
1717
const classes = useStyles()
1818

1919
return (
@@ -81,3 +81,5 @@ const useStyles = makeStyles((theme) => ({
8181
margin: theme.spacing(3, 0, 2),
8282
},
8383
}))
84+
85+
export default Login
File renamed without changes.

src/Auth/Recover/Recover.js renamed to src/Auth/Recover/Recover.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Link as RouterLink } from 'react-router-dom'
55
import AuthContent from '../_common/AuthContent'
66
import AuthHeader from '../_common/AuthHeader'
77

8-
export default function Login() {
8+
const Recover: React.FC = () => {
99
const classes = useStyles()
1010

1111
return (
@@ -58,3 +58,5 @@ const useStyles = makeStyles((theme) => ({
5858
margin: theme.spacing(3, 0, 2),
5959
},
6060
}))
61+
62+
export default Recover
File renamed without changes.

src/Auth/Reset/Reset.js renamed to src/Auth/Reset/Reset.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Link as RouterLink } from 'react-router-dom'
55
import AuthContent from '../_common/AuthContent'
66
import AuthHeader from '../_common/AuthHeader'
77

8-
export default function Login() {
8+
const Reset: React.FC = () => {
99
const classes = useStyles()
1010

1111
return (
@@ -67,3 +67,5 @@ const useStyles = makeStyles((theme) => ({
6767
margin: theme.spacing(3, 0, 2),
6868
},
6969
}))
70+
71+
export default Reset
File renamed without changes.

src/Auth/Signup/Signup.js renamed to src/Auth/Signup/Signup.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Link as RouterLink } from 'react-router-dom'
1313
import AuthContent from '../_common/AuthContent'
1414
import AuthHeader from '../_common/AuthHeader'
1515

16-
export default function SignUp() {
16+
const Signup: React.FC = () => {
1717
const classes = useStyles()
1818

1919
return (
@@ -116,3 +116,5 @@ const useStyles = makeStyles((theme) => ({
116116
margin: theme.spacing(3, 0, 2),
117117
},
118118
}))
119+
120+
export default Signup
File renamed without changes.

src/Auth/_common/AuthContent/AuthContent.js renamed to src/Auth/_common/AuthContent/AuthContent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from 'react'
22
import { makeStyles } from '@material-ui/core'
33

4-
const AuthContent = (props) => {
4+
export type AuthContentProps = {}
5+
6+
const AuthContent: React.FC<AuthContentProps> = (props) => {
57
const classes = useStyles()
68

79
return <div className={classes.paper}>{props.children}</div>
810
}
911

10-
AuthContent.propTypes = {}
11-
1212
const useStyles = makeStyles((theme) => ({
1313
paper: {
1414
display: 'flex',

0 commit comments

Comments
 (0)