From 46fac86ee673ed78a76ec139b87d7d19d79e1cec Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Fri, 17 Nov 2023 17:12:31 +0800 Subject: [PATCH] Refresh page on successful login or register --- src/Components/LoginModal/LoginModal.tsx | 10 +- .../RegisterModal/RegisterModal.tsx | 139 ++++++++++++++++++ src/Pages/LandingPage/LandingPage.tsx | 34 ++++- 3 files changed, 176 insertions(+), 7 deletions(-) create mode 100644 src/Components/RegisterModal/RegisterModal.tsx diff --git a/src/Components/LoginModal/LoginModal.tsx b/src/Components/LoginModal/LoginModal.tsx index 4ef16a4..3cf8c5a 100644 --- a/src/Components/LoginModal/LoginModal.tsx +++ b/src/Components/LoginModal/LoginModal.tsx @@ -9,7 +9,9 @@ import VisibilityOff from "@mui/icons-material/VisibilityOff"; import LoginIcon from "@mui/icons-material/Login"; import Checkbox from "@mui/material/Checkbox"; import Button from "../Buttons/Button"; +import { useNavigate } from "react-router-dom"; export default function LoginModal() { + const navigate = useNavigate(); const [showPassword, setShowPassword] = useState(false); const [remember, setRemember] = useState(true); const [user, setUser] = useState({ @@ -110,7 +112,13 @@ export default function LoginModal() { marginBottom: 8, }} /> -