From 56ea2c41654e57001a8ecb2f482dabedf2b535a1 Mon Sep 17 00:00:00 2001 From: keannu125 Date: Fri, 10 Mar 2023 20:47:54 +0800 Subject: [PATCH] Use hashrouter for github pages compatibility and make login and registration forms consistent --- src/App.tsx | 2 +- src/Routes/Login/Login.tsx | 2 ++ src/Routes/Register/Register.tsx | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index c3da8b4..1f8b4a5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -25,7 +25,7 @@ import Register from "./Routes/Register/Register"; const queryClient = new QueryClient(); -const router = createBrowserRouter([ +const router = createHashRouter([ { path: "/", element: ( diff --git a/src/Routes/Login/Login.tsx b/src/Routes/Login/Login.tsx index 55288c4..99f9e75 100644 --- a/src/Routes/Login/Login.tsx +++ b/src/Routes/Login/Login.tsx @@ -38,6 +38,7 @@ export default function Login() {
) => { setUser({ ...user, username: e.target.value }); }} @@ -50,6 +51,7 @@ export default function Login() { ) => { setUser({ ...user, password: e.target.value }); }} diff --git a/src/Routes/Register/Register.tsx b/src/Routes/Register/Register.tsx index 6fc148a..38a3ed8 100644 --- a/src/Routes/Register/Register.tsx +++ b/src/Routes/Register/Register.tsx @@ -32,6 +32,7 @@ export default function Register() {
) => { setUser({ ...user, email: e.target.value }); }} @@ -43,6 +44,7 @@ export default function Register() {
) => { setUser({ ...user, username: e.target.value }); }} @@ -55,6 +57,7 @@ export default function Register() { ) => { setUser({ ...user, password: e.target.value }); }}