Don't show Appnav on login page.
This commit is contained in:
parent
855c479caf
commit
207476efdc
|
|
@ -8,25 +8,20 @@
|
||||||
// This Source Code Form is "Incompatible With Secondary Licenses", as
|
// This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||||
// defined by the Mozilla Public License, v. 2.0.
|
// 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 { Container, Row, Col, Card, Button, Form } from "react-bootstrap";
|
||||||
import { atom, useAtomValue } from "jotai";
|
import { atom, useAtomValue } from "jotai";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
|
||||||
export function Login() {
|
export function Login() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<AppNav />
|
|
||||||
<Container className="vert-padded">
|
<Container className="vert-padded">
|
||||||
<LoginForm />
|
<LoginForm />
|
||||||
</Container>
|
</Container>
|
||||||
<Footer />
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function LoginForm() {
|
function LoginForm() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
|
@ -39,7 +34,7 @@ function LoginForm() {
|
||||||
console.log(formData);
|
console.log(formData);
|
||||||
|
|
||||||
const resp = await fetch("/api/login", {
|
const resp = await fetch("/api/login", {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
|
|
@ -48,7 +43,7 @@ function LoginForm() {
|
||||||
if (resp.redirected) {
|
if (resp.redirected) {
|
||||||
navigate("/");
|
navigate("/");
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
return (
|
return (
|
||||||
<Form onSubmit={onSubmit}>
|
<Form onSubmit={onSubmit}>
|
||||||
<Form.Group controlId="passwordForm">
|
<Form.Group controlId="passwordForm">
|
||||||
|
|
@ -56,9 +51,7 @@ function LoginForm() {
|
||||||
<Form.Control name="password" type="password" />
|
<Form.Control name="password" type="password" />
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
|
|
||||||
<Button type="submit">
|
<Button type="submit">Submit</Button>
|
||||||
Submit
|
|
||||||
</Button>
|
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue