#13 Made login page that actually send request to backend. CORS stuff.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Nav, Container, Navbar, NavDropdown } from "react-bootstrap";
|
||||
import { Nav, Container, Navbar } from "react-bootstrap";
|
||||
|
||||
const MyNavbar = () => {
|
||||
return (
|
||||
|
||||
@@ -1,27 +1,61 @@
|
||||
import React from "react";
|
||||
import { Col, Container, Form, Row } from "react-bootstrap";
|
||||
import React, { useState } from "react";
|
||||
import { Button, Col, Container, Form, Row } from "react-bootstrap";
|
||||
import MyNavbar from "../components/MyNavbar";
|
||||
import { makeRequest } from "../utils.ts";
|
||||
|
||||
const LoginPage = () => {
|
||||
const [username, setUsername] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
|
||||
const sendLoginRequest = async () => {
|
||||
// await makeRequest({
|
||||
// url: "http://localhost:5000/login",
|
||||
// method: "POST",
|
||||
// body: { username, password },
|
||||
// })
|
||||
// .then((resp) => resp.json())
|
||||
// .then((data) => {
|
||||
// console.log(data);
|
||||
// });
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<MyNavbar />
|
||||
<Container className="p-5">
|
||||
<Form>
|
||||
<Form.Group as={Row} className="mb-3" controlId="username">
|
||||
<Form.Label column sm={2}>
|
||||
<Form.Label column sm={2} className="me-2">
|
||||
Username
|
||||
</Form.Label>
|
||||
<Col sm={10}>
|
||||
<Form.Control type="username" placeholder="username" />
|
||||
<Col sm={9}>
|
||||
<Form.Control
|
||||
type="username"
|
||||
placeholder="username"
|
||||
onChange={(e) => {
|
||||
setUsername(e.target.value);
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3" controlId="password">
|
||||
<Form.Label column sm={2}>
|
||||
<Form.Label column sm={2} className="me-2">
|
||||
Password
|
||||
</Form.Label>
|
||||
<Col sm={10}>
|
||||
<Form.Control type="password" placeholder="password" />
|
||||
<Col sm={9}>
|
||||
<Form.Control
|
||||
type="password"
|
||||
placeholder="password"
|
||||
onChange={(e) => {
|
||||
setPassword(e.target.value);
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3" controlId="submit">
|
||||
<Col sm={2}></Col>
|
||||
<Col sm={2}>
|
||||
<Button type="submit">Submit</Button>
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row}>
|
||||
|
||||
Reference in New Issue
Block a user