From 3396819d2922d0f71da5f32c7e622dbf71d0adb1 Mon Sep 17 00:00:00 2001 From: Arnaud Fauconnet Date: Thu, 20 Oct 2022 17:48:03 +0200 Subject: [PATCH] Fixed style conflicting --- src/components/App.tsx | 10 ----- src/components/ErrorPage.tsx | 4 +- src/components/ForgotPassword.tsx | 61 ++++++++++++++++--------------- src/components/Login.tsx | 8 ++-- src/components/Reset.tsx | 4 +- src/components/index.tsx | 3 +- src/scss/cards.scss | 2 +- 7 files changed, 41 insertions(+), 51 deletions(-) delete mode 100644 src/components/App.tsx diff --git a/src/components/App.tsx b/src/components/App.tsx deleted file mode 100644 index bc2b5ca..0000000 --- a/src/components/App.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react' -import Login from "@components/Login" -// import variables from "@scss/variables.module.scss" -import "@scss/style.scss" - -export default function App() { - return ( - - ); -} diff --git a/src/components/ErrorPage.tsx b/src/components/ErrorPage.tsx index 44abf21..8527716 100644 --- a/src/components/ErrorPage.tsx +++ b/src/components/ErrorPage.tsx @@ -1,4 +1,4 @@ -import * as React from "react"; +import React from "react"; import { useRouteError } from "react-router-dom"; import "@scss/error.scss" @@ -7,7 +7,7 @@ export default function ErrorPage() { console.error(error); return ( -
+

Oops!

Sorry, an unexpected error has occurred.

diff --git a/src/components/ForgotPassword.tsx b/src/components/ForgotPassword.tsx index 6426677..c4ba8fb 100644 --- a/src/components/ForgotPassword.tsx +++ b/src/components/ForgotPassword.tsx @@ -14,7 +14,7 @@ export default function ForgotPassword() { function buttonCancel(e: MouseEvent) { e.preventDefault(); - navigate("/") + navigate("/login") } function buttonSubmit(e: MouseEvent) { @@ -24,36 +24,37 @@ export default function ForgotPassword() { } return ( -
+
-

Forgot Passowrd

-

- If you have forgot your password, we can send you an email - with a link to reset it. -

- -
- - -
+

Forgot Passowrd

+

+ If you have forgot your password, we can send you an email + with a link to reset it. +

+ +
+ + +
); diff --git a/src/components/Login.tsx b/src/components/Login.tsx index a88ddd5..11ea462 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -1,7 +1,7 @@ -import React, { useState, ChangeEvent, MouseEvent } from "react"; +import React, { useState, ChangeEvent, MouseEvent, useEffect } from "react"; import { Card, Button, TextField } from "@mui/material" import "@scss/login.scss" -import { Link, Navigate, useNavigate } from "react-router-dom"; +import { Link, useNavigate } from "react-router-dom"; export default function Login() { const [email, setEmail] = useState(""); @@ -25,11 +25,11 @@ export default function Login() { function buttonSubmit(e: MouseEvent) { e.preventDefault(); console.log(`Sumbitting username "${email}" and password "${hash(password)}"`) - navigate("/main") + navigate("/") } return ( -
+

Login

diff --git a/src/components/Reset.tsx b/src/components/Reset.tsx index 5589662..984f2e6 100644 --- a/src/components/Reset.tsx +++ b/src/components/Reset.tsx @@ -26,7 +26,7 @@ export default function Reset() { e.preventDefault(); if (password == confirmPassword && password.length != 0){ console.log(`Sumbitting password "${hash(password)}"`) - navigate("/") + navigate("/login") } else{ console.warn("Passwords are not matching or are empty"); @@ -34,7 +34,7 @@ export default function Reset() { } return ( -
+

Reset Password

diff --git a/src/components/index.tsx b/src/components/index.tsx index 68d5dfc..5eb6190 100644 --- a/src/components/index.tsx +++ b/src/components/index.tsx @@ -1,7 +1,6 @@ -import App from "@components/App"; import Login from "@components/Login"; import ForgotPassword from "@components/ForgotPassword"; import Reset from "@components/Reset"; import ErrorPage from "@components/ErrorPage"; -export { App, Login, ForgotPassword, Reset, ErrorPage }; \ No newline at end of file +export { Login, ForgotPassword, Reset, ErrorPage }; \ No newline at end of file diff --git a/src/scss/cards.scss b/src/scss/cards.scss index 9137fc8..e022eb6 100644 --- a/src/scss/cards.scss +++ b/src/scss/cards.scss @@ -1,4 +1,4 @@ -main { +main.cardContainer { height: 100vh; display: flex; justify-content: center;