Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 7be2835

Browse files
committed
Redesigned Login Area
1 parent e21e761 commit 7be2835

File tree

4 files changed

+58
-14
lines changed

4 files changed

+58
-14
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ local.properties
8484

8585
*/.idea/
8686

87+
/.idea
88+
8789
# Sensitive or high-churn files
8890
*/.idea/**/dataSources/
8991
*/.idea/**/dataSources.ids

src/components/basicElements/Login.css

Whitespace-only changes.

src/components/basicElements/Login.tsx

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
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";
33
import {loginWithUsernameAndPassword} from "../../background/api/auth";
44

5+
import logo from "../../assets/images/logos/logoWithWhiteBorder.png";
6+
57
function Login(): ReactElement {
68
const [userName, setUsername] = useState<string>("");
79
const [password, setPassword] = useState<string>("");
@@ -30,40 +32,56 @@ function Login(): ReactElement {
3032

3133

3234
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>
3652
<Form onSubmit={handleSubmit}>
3753
<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)}/>
4055
</Form.Group>
4156

4257
<Form.Group controlId="formBasicPassword">
43-
<Form.Label>Password</Form.Label>
4458
<Form.Control type="password" placeholder="Password" value={password} onChange={event => setPassword(event.target.value)}/>
4559
<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.
4761
</Form.Text>
4862
</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>
5365
<Spinner
5466
as="span"
5567
animation="grow"
5668
size="sm"
5769
role="status"
5870
aria-hidden="true"
5971
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
6173
</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>
6380
<p className="text-danger">{errorMessage}</p>
6481
</Form>
6582
</Col>
6683
</Row>
84+
</Container>
6785
</Container>);
6886
}
6987

src/style/helpers.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
.text-shadow-none{
22
text-shadow: none;
33
}
4+
5+
.center-items {
6+
display: flex;
7+
align-items: center;
8+
justify-content: center;
9+
}
10+
11+
12+
.login-container {
13+
14+
border-radius: 15px;
15+
background-color: #333333;
16+
@media (min-width: 992px) {
17+
width: 50%;
18+
left: 25%;
19+
}
20+
@media (max-height: 659px) {
21+
margin-top: 15px;
22+
}
23+
@media (min-height: 660px) {
24+
margin-top: 10%;
25+
}
26+
padding-top: 15px
27+
}

0 commit comments

Comments
 (0)