Use hashrouter for github pages compatibility and make login and registration forms consistent

This commit is contained in:
keannu125 2023-03-10 20:47:54 +08:00
parent e66bff306f
commit 56ea2c4165
3 changed files with 6 additions and 1 deletions

View file

@ -25,7 +25,7 @@ import Register from "./Routes/Register/Register";
const queryClient = new QueryClient();
const router = createBrowserRouter([
const router = createHashRouter([
{
path: "/",
element: (

View file

@ -38,6 +38,7 @@ export default function Login() {
<div style={{ margin: 4 }} />
<input
style={styles.input_notetitle}
value={user.username}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setUser({ ...user, username: e.target.value });
}}
@ -50,6 +51,7 @@ export default function Login() {
<input
style={styles.input_notetitle}
type="password"
value={user.password}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setUser({ ...user, password: e.target.value });
}}

View file

@ -32,6 +32,7 @@ export default function Register() {
<div style={{ margin: 4 }} />
<input
style={styles.text_L}
value={user.email}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setUser({ ...user, email: e.target.value });
}}
@ -43,6 +44,7 @@ export default function Register() {
<div style={{ margin: 4 }} />
<input
style={styles.text_L}
value={user.username}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setUser({ ...user, username: e.target.value });
}}
@ -55,6 +57,7 @@ export default function Register() {
<input
style={styles.text_L}
type="password"
value={user.password}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setUser({ ...user, password: e.target.value });
}}