Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend Refactor Auth #1020

Merged
merged 4 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from "react";
import { useMutation } from "react-query";
import { useMutation, useQuery } from "react-query";
import styles from "./CreateAchievement.module.scss";
import "react-datepicker/dist/react-datepicker.css";
import { Button, Input, Upload } from "antd";
Expand Down
33 changes: 25 additions & 8 deletions app/frontend/src/Pages/Login/Login.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,38 @@
}

.innerContainer {
display: flex;
flex-direction: row;
align-items: center;
height: 100%;
gap: 4rem;
}

.formContainer {
padding: 2rem;
border: 1px solid gray;
border-radius: 10px;
margin-top: 10rem;
width: 30rem;
background-image: url("../../../assets/images/lol.jpeg");
background-size: cover;
background-repeat: no-repeat;
}

.infoContainer {
display: flex;
flex-direction: column;
align-items: center;
}

.loginHeader {
color: orange;
color: white;
margin-top: 0;
margin-bottom: 0.5rem;
margin-bottom: 2rem;
}

.loginInfo {
color: white;
font-weight: normal;
margin-top: 0;
margin-bottom: 1.5rem;
color: black;
font-weight: bold;
}

.loginForm {
Expand All @@ -36,7 +47,7 @@
}

.formElem {
margin-bottom: 1rem;
margin-bottom: 2rem;
width: 100%;
padding: 0.4rem;
font-size: 14px;
Expand All @@ -59,3 +70,9 @@
.ant-input input {
font-size: 20px;
}

.image {
width: 20rem;
height: 20rem;
border-radius: 50%;
}
129 changes: 69 additions & 60 deletions app/frontend/src/Pages/Login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,68 +52,77 @@ function Login() {
return (
<div className={styles.outerContainer}>
<div className={styles.innerContainer}>
<h2 className={styles.loginHeader}>Login</h2>
<h5 className={styles.loginInfo}>
Join the Fun - Login and Conquer the Game World!
</h5>
<div className={styles.loginForm}>
<form onSubmit={(event) => handleLogin(event)}>
<Input
size="large"
placeholder="Please enter your Email"
className={styles.formElem}
prefix={
<UserOutlined
style={{ fontSize: "1.2rem", marginRight: "0.4rem" }}
/>
}
value={email}
onChange={(event) => setEmail(event.target.value)}
/>
<div className={styles.infoContainer}>
<img
className={styles.image}
src="../../../assets/images/guru.jpeg"
></img>
<h5 className={styles.loginInfo}>
Join the Fun - Login and Conquer the Game World!
</h5>
</div>
<div className={styles.formContainer}>
<h2 className={styles.loginHeader}>Login</h2>

<div className={styles.loginForm}>
<form onSubmit={(event) => handleLogin(event)}>
<Input
size="large"
placeholder="Please enter your Email"
className={styles.formElem}
prefix={
<UserOutlined
style={{ fontSize: "1.2rem", marginRight: "0.4rem" }}
/>
}
value={email}
onChange={(event) => setEmail(event.target.value)}
/>

<Input.Password
placeholder="Password"
prefix={
<LockOutlined
style={{ fontSize: "1.2rem", marginRight: "0.4rem" }}
/>
}
iconRender={(visible) =>
visible ? (
<EyeTwoTone style={{ fontSize: "1rem" }} />
) : (
<EyeInvisibleOutlined style={{ fontSize: "1rem" }} />
)
}
className={styles.formElem}
value={password}
onChange={(event) => setPassword(event.target.value)}
/>
<Input.Password
placeholder="Password"
prefix={
<LockOutlined
style={{ fontSize: "1.2rem", marginRight: "0.4rem" }}
/>
}
iconRender={(visible) =>
visible ? (
<EyeTwoTone style={{ fontSize: "1rem" }} />
) : (
<EyeInvisibleOutlined style={{ fontSize: "1rem" }} />
)
}
className={styles.formElem}
value={password}
onChange={(event) => setPassword(event.target.value)}
/>

<div className={styles.buttonContainer}>
<Button
type="primary"
htmlType="submit"
style={{ width: "100%" }}
>
Login
</Button>
<Button
type="link"
onClick={() => navigate("/register")}
className={styles.navigationLink}
>
Don't you have an account? Register
</Button>
<Button
type="link"
onClick={() => navigate("/forgotpassword")}
className={styles.navigationLink}
>
Forgot Password
</Button>
</div>
</form>
<div className={styles.buttonContainer}>
<Button
type="primary"
htmlType="submit"
style={{ width: "100%" }}
>
Login
</Button>
<Button
type="link"
onClick={() => navigate("/register")}
className={styles.navigationLink}
>
Don't you have an account? Register
</Button>
<Button
type="link"
onClick={() => navigate("/forgotpassword")}
className={styles.navigationLink}
>
Forgot Password
</Button>
</div>
</form>
</div>
</div>
</div>
</div>
Expand Down
33 changes: 25 additions & 8 deletions app/frontend/src/Pages/Register/Register.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,36 @@
}

.innerContainer {
display: flex;
flex-direction: row;
align-items: center;
height: 100%;
gap: 4rem;
}

.formContainer {
padding: 2rem;
border: 1px solid gray;
border-radius: 10px;
margin-top: 10rem;
width: 30rem;
background-image: url("../../../assets/images/cs.png");
}

.infoContainer {
display: flex;
flex-direction: column;
align-items: center;
}

.registerHeader {
color: orange;
color: white;
margin-top: 0;
margin-bottom: 0.5rem;
margin-bottom: 2rem;
}

.registerInfo {
color: white;
font-weight: normal;
margin-top: 0;
margin-bottom: 1.5rem;
color: black;
font-weight: bold;
}

.registerForm {
Expand All @@ -34,7 +45,7 @@
}

.formElem {
margin-bottom: 1rem;
margin-bottom: 2rem;
width: 100%;
padding: 0.4rem;
font-size: 14px;
Expand Down Expand Up @@ -63,3 +74,9 @@
.navigationLink {
color: white;
}

.image {
width: 20rem;
height: 20rem;
border-radius: 50%;
}
Loading