Don't show Appnav on login page.
This commit is contained in:
parent
855c479caf
commit
207476efdc
|
|
@ -8,57 +8,50 @@
|
|||
// This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
// defined by the Mozilla Public License, v. 2.0.
|
||||
//
|
||||
import { AppNav, Footer } from "./components/AppNav.tsx";
|
||||
import { Container, Row, Col, Card, Button, Form } from "react-bootstrap";
|
||||
import { atom, useAtomValue } from "jotai";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
|
||||
export function Login() {
|
||||
return (
|
||||
<div>
|
||||
<AppNav />
|
||||
<Container className="vert-padded">
|
||||
<LoginForm />
|
||||
<LoginForm />
|
||||
</Container>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function LoginForm() {
|
||||
const navigate = useNavigate();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const onSubmit = async (event) => {
|
||||
event.preventDefault();
|
||||
const onSubmit = async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
console.log(event.target);
|
||||
const formEntries = new FormData(event.target);
|
||||
const formData = Object.fromEntries(formEntries);
|
||||
console.log(formData);
|
||||
console.log(event.target);
|
||||
const formEntries = new FormData(event.target);
|
||||
const formData = Object.fromEntries(formEntries);
|
||||
console.log(formData);
|
||||
|
||||
const resp = await fetch("/api/login", {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(formData),
|
||||
});
|
||||
if(resp.redirected) {
|
||||
navigate("/");
|
||||
}
|
||||
const resp = await fetch("/api/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(formData),
|
||||
});
|
||||
if (resp.redirected) {
|
||||
navigate("/");
|
||||
}
|
||||
return (
|
||||
<Form onSubmit={onSubmit}>
|
||||
<Form.Group controlId="passwordForm">
|
||||
<Form.Label>Password</Form.Label>
|
||||
<Form.Control name="password" type="password" />
|
||||
</Form.Group>
|
||||
};
|
||||
return (
|
||||
<Form onSubmit={onSubmit}>
|
||||
<Form.Group controlId="passwordForm">
|
||||
<Form.Label>Password</Form.Label>
|
||||
<Form.Control name="password" type="password" />
|
||||
</Form.Group>
|
||||
|
||||
<Button type="submit">
|
||||
Submit
|
||||
</Button>
|
||||
</Form>
|
||||
);
|
||||
<Button type="submit">Submit</Button>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue