Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 31148ef

Browse files
committed
Login page has been updated.
1 parent e833e32 commit 31148ef

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

‎day-15/bs-store/src/components/adminAppbar/AdminAppbar.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@ const AdminAppbar = () => {
133133
{page}
134134
</Button>
135135
))}
136+
136137
</Box>
137138
<Box>
138-
<Buttonsx={{color:'#fff'}}onClick={navigate("/auth/login")}>Login</Button>
139+
139140
</Box>
140141

141142
<Box sx={{ flexGrow: 0 }}>
@@ -169,6 +170,13 @@ const AdminAppbar = () => {
169170

170171
</Box>
171172
<ThemeMenu />
173+
<div>
174+
<Button
175+
key="login"
176+
onClick={() => navigate("/auth/login")}
177+
sx={{ my: 2, color: "white", display: "block" }}
178+
>Login</Button>
179+
</div>
172180

173181

174182

‎day-15/bs-store/src/pages/login/Login.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import { useFormik } from "formik";
44
import AuthService from "../../services/AuthService";
55
import { showSnackbar } from "../../store/actions/settingActions";
66
import { useDispatch } from "react-redux";
7+
import { useNavigate } from "react-router-dom";
78
export default function Login() {
89
const authService = new AuthService();
9-
10+
constnavigate=useNavigate();
1011
const authDispatch = useDispatch();
1112

1213
const { handleSubmit, handleChange, values } = useFormik({
@@ -30,6 +31,7 @@ export default function Login() {
3031
severity: "success",
3132
})
3233
);
34+
navigate("/home");
3335
} else {
3436
authDispatch(
3537
showSnackbar({

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /