#13 Error alert formatting
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from "react";
|
||||
import { Button, Col, Container, Form, Row, Alert} from "react-bootstrap";
|
||||
import { Button, Col, Container, Form, Row, Alert } from "react-bootstrap";
|
||||
import MyNavbar from "../components/MyNavbar";
|
||||
import { makeRequest } from "../utils.ts";
|
||||
|
||||
@@ -9,7 +9,7 @@ const LoginPage = () => {
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
const sendLoginRequest = async (e) => {
|
||||
e.preventDefault();
|
||||
e?.preventDefault();
|
||||
await makeRequest({
|
||||
url: "http://localhost:5000/login",
|
||||
method: "POST",
|
||||
@@ -29,8 +29,12 @@ const LoginPage = () => {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<MyNavbar />
|
||||
{ error && (
|
||||
<Alert variant="danger" className="m-4 mx-auto w-25">ERROR! {error.message}</Alert>
|
||||
{error && (
|
||||
<Container>
|
||||
<Alert variant="danger" className="m-4 mx-auto w-50 text-center">
|
||||
{error.message}
|
||||
</Alert>
|
||||
</Container>
|
||||
)}
|
||||
<Container className="p-5">
|
||||
<Form onSubmit={sendLoginRequest}>
|
||||
|
||||
Reference in New Issue
Block a user