|
1 | 1 | import React, {FormEvent, ReactElement, useState} from 'react';
|
2 |
| -import {Button, Form, Container, Row,Col,Spinner} from "react-bootstrap"; |
| 2 | +import {Button, Form, Container, Row,Col,Spinner, Image} from "react-bootstrap"; |
3 | 3 | import {loginWithUsernameAndPassword} from "../../background/api/auth";
|
4 | 4 |
|
| 5 | +import logo from "../../assets/images/logos/logoWithWhiteBorder.png"; |
| 6 | + |
5 | 7 | function Login(): ReactElement {
|
6 | 8 | const [userName, setUsername] = useState<string>("");
|
7 | 9 | const [password, setPassword] = useState<string>("");
|
@@ -30,40 +32,56 @@ function Login(): ReactElement {
|
30 | 32 |
|
31 | 33 |
|
32 | 34 | return (
|
33 |
| - <Container> |
34 |
| - <Row > |
35 |
| - <Col md={{ span: 6, offset: 3 }}> |
| 35 | + <Container className="h-100"> |
| 36 | + <Container fluid className="login-container"> |
| 37 | + |
| 38 | + <Container> |
| 39 | + <Row className="justify-content-md-center"> |
| 40 | + <Image rounded src={logo} height="200px" width="auto"/> |
| 41 | + </Row> |
| 42 | + <Row className="justify-content-md-center"> |
| 43 | + <h1>Greetings Traveller!</h1> |
| 44 | + </Row> |
| 45 | + <Row className="justify-content-md-center"> |
| 46 | + <h2>Be welcome at FileFighter</h2> |
| 47 | + </Row> |
| 48 | + </Container> |
| 49 | + |
| 50 | + <Row className="mt-4"> |
| 51 | + <Col> |
36 | 52 | <Form onSubmit={handleSubmit}>
|
37 | 53 | <Form.Group controlId="formBasicUsername">
|
38 |
| - <Form.Label>Username</Form.Label> |
39 |
| - <Form.Control placeholder="Enter username" value={userName} onChange={event => setUsername(event.target.value)}/> |
| 54 | + <Form.Control placeholder="Username" value={userName} onChange={event => setUsername(event.target.value)}/> |
40 | 55 | </Form.Group>
|
41 | 56 |
|
42 | 57 | <Form.Group controlId="formBasicPassword">
|
43 |
| - <Form.Label>Password</Form.Label> |
44 | 58 | <Form.Control type="password" placeholder="Password" value={password} onChange={event => setPassword(event.target.value)}/>
|
45 | 59 | <Form.Text className="text-muted">
|
46 |
| - Contact your administrator if you have forgotten your password. |
| 60 | + Contact your administrator if you have forgotten your login details. |
47 | 61 | </Form.Text>
|
48 | 62 | </Form.Group>
|
49 |
| - <Form.Group controlId="formBasicCheckbox"> |
50 |
| - <Form.Check checked={stayLoggedIn} type="checkbox" label="Stay logged in. (By clicking this you accept the usage of cookies.)" onChange={() => setStayLoggedIn(!stayLoggedIn)}/> |
51 |
| - </Form.Group> |
52 |
| - <Button variant="primary" type="submit" > |
| 63 | + |
| 64 | + <Button variant="primary" type="submit" block> |
53 | 65 | <Spinner
|
54 | 66 | as="span"
|
55 | 67 | animation="grow"
|
56 | 68 | size="sm"
|
57 | 69 | role="status"
|
58 | 70 | aria-hidden="true"
|
59 | 71 | className={loading? "" :"d-none"}
|
60 |
| - /> <span className={loading? "sr-only" :"d-none"}>Loading...</span>Submit |
| 72 | + /> <span className={loading? "sr-only" :"d-none"}>Loading...</span>Sign in |
61 | 73 | </Button>
|
62 |
| - |
| 74 | + <Form.Group controlId="formBasicCheckbox" className="mt-3 justify-content-center"> |
| 75 | + <Form.Check checked={stayLoggedIn} type="checkbox" label="Keep me signed in*" onChange={() => setStayLoggedIn(!stayLoggedIn)}/> |
| 76 | + <Form.Text className="text-muted"> |
| 77 | + *By clicking this, you accept the usage of cookies. |
| 78 | + </Form.Text> |
| 79 | + </Form.Group> |
63 | 80 | <p className="text-danger">{errorMessage}</p>
|
64 | 81 | </Form>
|
65 | 82 | </Col>
|
66 | 83 | </Row>
|
| 84 | + </Container> |
67 | 85 | </Container>);
|
68 | 86 | }
|
69 | 87 |
|
|
0 commit comments