Skip to content

Commit ede3e78

Browse files
committed
clean up
1 parent e70a644 commit ede3e78

File tree

4 files changed

+14
-32
lines changed

4 files changed

+14
-32
lines changed

client/src/components/Auth/auth-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const AuthForm = ({ isSignup = false, onSubmit }) => {
136136
type="submit"
137137
className={styles.submitBtn}
138138
>
139-
{isSignup ? "Sign In" : "Sign Up"}
139+
{isSignup ? "Sign Up" : "Sign In"}
140140
</button>
141141
)}
142142
</div>

client/src/components/Auth/index.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React from "react";
22
import { Container } from "@material-ui/core";
33
import { Switch, Route, useHistory } from "react-router-dom";
4-
import SignupForm from "./signup-form";
5-
import LoginForm from "./login-form";
4+
import AuthForm from "./auth-form";
5+
import { useDispatch } from "react-redux";
6+
import { signin, signup } from "../../actions/auth";
67

78
const Auth = () => {
89
const history = useHistory();
@@ -13,11 +14,19 @@ const Auth = () => {
1314
history.push("/dashboard");
1415
}
1516

17+
const dispatch = useDispatch();
18+
1619
return (
1720
<Container component="main" maxWidth="xs">
1821
<Switch>
19-
<Route path="/login" component={LoginForm} />
20-
<Route path="/signup" component={SignupForm} />
22+
<Route
23+
path="/login"
24+
component={() => <AuthForm onSubmit={() => dispatch(signin())} />}
25+
/>
26+
<Route
27+
path="/signup"
28+
component={() => <AuthForm isSignup onSubmit={() => dispatch(signup())} />}
29+
/>
2130
</Switch>
2231
</Container>
2332
);

client/src/components/Auth/login-form.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

client/src/components/Auth/signup-form.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)