Skip to content

Commit f3d4798

Browse files
feat(frontend): new login/register design
1 parent 9896d11 commit f3d4798

9 files changed

Lines changed: 68 additions & 18 deletions

File tree

frontend/public/images/login.png

106 KB
Loading

frontend/src/App.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ body {
1717
--dark-golden: #ff9c08;
1818
--light-golden: #ffd166;
1919
--heading-font: "Montserrat", sans-serif;
20+
--my-cyan: #10abc2;
21+
--my-dcyan: #0f95aa;
2022
}
2123

2224
body::-webkit-scrollbar {

frontend/src/components/FormikTextField.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { TextField } from "@material-ui/core";
22
import { FieldHookConfig, useField } from "formik";
33
import React from "react";
4+
import { useSignupLoginStyles } from "./RegistrationForm/signupLoginStyle";
45

56
type FormikTextFieldProps = {
67
className: string;
@@ -16,6 +17,7 @@ const FormikTextField: React.FC<FormikTextFieldProps> = ({
1617
...props
1718
}) => {
1819
// eslint-disable-next-line @typescript-eslint/ban-types
20+
const classes = useSignupLoginStyles();
1921
const [field, meta] = useField<string>(props);
2022
const errorText = meta.error && meta.touched ? meta.error : "";
2123
const obj = {
@@ -29,6 +31,19 @@ const FormikTextField: React.FC<FormikTextFieldProps> = ({
2931
{...field}
3032
helperText={errorText}
3133
error={!!errorText}
34+
InputLabelProps={{
35+
classes: {
36+
root: classes.cssLabel,
37+
focused: classes.cssFocused,
38+
},
39+
}}
40+
InputProps={{
41+
classes: {
42+
root: classes.cssOutlinedInput,
43+
focused: classes.cssFocused,
44+
notchedOutline: classes.notchedOutline,
45+
},
46+
}}
3247
variant="outlined"
3348
/>
3449
);

frontend/src/components/RegistrationForm/Login.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ const validSchema = yup.object({
2020
.required()
2121
.max(64)
2222
.matches(/^[a-zA-Z0-9]+(@iiitdmj\.ac\.in)$/, "Invalid Email"),
23-
password: yup
24-
.string()
25-
.required()
26-
.min(6)
27-
.matches(/[0-9]/, "Password must include atleast 1 digit"),
23+
password: yup.string().required().min(6),
2824
});
2925

3026
const Login: React.FC<LoginProps> = ({ setPage }) => {

frontend/src/components/RegistrationForm/index.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ import BackButton from "../Buttons/BackButton";
99

1010
const useStyles = makeStyles((theme: Theme) =>
1111
createStyles({
12+
main: {
13+
width: "30vw",
14+
background: "#1c1c1c",
15+
[theme.breakpoints.down("sm")]: {
16+
width: "90vw",
17+
},
18+
color: "#ededed",
19+
},
1220
title: {
1321
margin: "3vh",
1422
fontWeight: "bold",
@@ -19,15 +27,12 @@ const useStyles = makeStyles((theme: Theme) =>
1927
display: "flex",
2028
alignItems: "center",
2129
},
22-
main: {
23-
width: "30vw",
24-
[theme.breakpoints.down("sm")]: {
25-
width: "90vw",
26-
},
27-
},
2830
or: {
2931
margin: "2vh",
3032
},
33+
icon: {
34+
color: "#10ABC2",
35+
},
3136
})
3237
);
3338

@@ -44,7 +49,7 @@ const RegistrationForm: React.FC = () => {
4449
return (
4550
<Paper className={classes.main}>
4651
<div className={classes.flexbox}>
47-
<BackButton />
52+
<BackButton className={classes.icon} />
4853
<Typography className={classes.title} align="center">
4954
{heading[page]}
5055
</Typography>

frontend/src/components/RegistrationForm/signupLoginStyle.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,37 @@ export const useSignupLoginStyles = makeStyles(() =>
1010
input: {
1111
marginBottom: "2vh",
1212
width: "80%",
13+
background: "transparent",
14+
},
15+
cssLabel: {
16+
color: "#ededed",
17+
},
18+
19+
cssOutlinedInput: {
20+
"&$cssFocused $notchedOutline": {
21+
borderColor: `#ededed !important`,
22+
},
23+
color: "#ededed",
24+
},
25+
26+
cssFocused: {
27+
color: "#ededed",
28+
},
29+
30+
notchedOutline: {
31+
borderWidth: "1px",
32+
borderColor: "#ededed !important",
1333
},
1434
btn: {
15-
background: "var(--golden)",
35+
background: "var(--my-cyan)",
1636
margin: "2vh",
1737
"&:hover": {
18-
background: "var(--dark-golden)",
38+
background: "var(--my-dcyan)",
1939
},
2040
},
2141
link: {
2242
cursor: "pointer",
43+
color: "#00a6ed",
2344
},
2445
footer: {
2546
marginBottom: "2vh",

frontend/src/pages/Projects/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from "react";
2-
import NavBar from "../../components/Navs/Navbar";
32
import { createStyles, makeStyles } from "@material-ui/core/styles";
43
import ProjectCardv2 from "src/components/Cards/ProjectCardv2";
54
import { projectlist } from "./projectlist";
65
import useWindowDimensions from "../../utils/useWindowDimensions";
76
import ProjectCard from "src/components/Cards/ProjectCard";
7+
import Nav2 from "src/components/Navs/Nav_v2";
88

99
const useStyles = makeStyles(() =>
1010
createStyles({
@@ -32,7 +32,7 @@ const Projects: React.FC = () => {
3232
const { width } = useWindowDimensions();
3333
return (
3434
<div className={classes.root}>
35-
<NavBar />
35+
<Nav2 />
3636
<div className={classes.flexbox}>
3737
{projectlist.map((project, key) => {
3838
if (width > 600) {

frontend/src/pages/Registration/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ import { createStyles, makeStyles } from "@material-ui/core/styles";
33
import RegistrationForm from "../../components/RegistrationForm";
44
import useTokenStore from "../../store/tokenStore";
55
import { useHistory } from "react-router";
6+
import Nav2 from "src/components/Navs/Nav_v2";
67

78
const useStyles = makeStyles(() =>
89
createStyles({
910
root: {
10-
height: "100vh",
11+
minHeight: "100vh",
12+
},
13+
flexbox: {
14+
marginTop: "5vh",
1115
display: "flex",
1216
justifyContent: "center",
1317
alignItems: "center",
@@ -27,7 +31,10 @@ const Registration: React.FC = () => {
2731

2832
return (
2933
<div className={classes.root}>
30-
<RegistrationForm />
34+
<Nav2 />
35+
<div className={classes.flexbox}>
36+
<RegistrationForm />
37+
</div>
3138
</div>
3239
);
3340
};

frontend/src/theme/theme.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createMuiTheme } from "@material-ui/core";
2+
import blue from "@material-ui/core/colors/blue";
23

34
const Theme = createMuiTheme({
45
breakpoints: {
@@ -10,6 +11,9 @@ const Theme = createMuiTheme({
1011
xl: 1920,
1112
},
1213
},
14+
palette: {
15+
primary: blue,
16+
},
1317
});
1418

1519
export default Theme;

0 commit comments

Comments
 (0)