From 62ce2ac78dc1e75974a53258e329a6f0ac26250f Mon Sep 17 00:00:00 2001 From: Amrutanshu Date: Tue, 18 Mar 2025 13:46:18 +0530 Subject: [PATCH 1/2] completed chore of code cleaning --- src/pages/SignUp.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/SignUp.jsx b/src/pages/SignUp.jsx index 0b20a3b..6cba3a7 100644 --- a/src/pages/SignUp.jsx +++ b/src/pages/SignUp.jsx @@ -1,6 +1,5 @@ import React, { useState } from "react"; import { auth, sendSignInLinkToEmail } from "../firebase"; -import { useNavigate } from "react-router-dom"; import styled from "styled-components"; import { theme } from "../styles/theme"; From 1e643bc51a204759d75fcb5bc41475be7a119977 Mon Sep 17 00:00:00 2001 From: Amrutanshu Date: Tue, 18 Mar 2025 13:46:48 +0530 Subject: [PATCH 2/2] git commit -m"completed chore of code cleaning" --- src/pages/Dashboard.jsx | 32 +++++++++---------- src/pages/SignUp.jsx | 71 +++++++++++++++++++++-------------------- 2 files changed, 52 insertions(+), 51 deletions(-) diff --git a/src/pages/Dashboard.jsx b/src/pages/Dashboard.jsx index e5e80ab..15b8f26 100644 --- a/src/pages/Dashboard.jsx +++ b/src/pages/Dashboard.jsx @@ -44,23 +44,23 @@ const TopRightIcon = styled(FaUser)` `; const Dashboard = ({ user }) => { - const navigate = useNavigate(); + const navigate = useNavigate(); - return ( - - - navigate("/profile")}>User Profile - navigate("/profile#scores")}>Scores - navigate("/upload")}>Upload Resume - Coordinator Dashboard - - -

Welcome, {user?.email.toUpperCase()}

-

Select an option from the sidebar.

-
- navigate("/profile")} /> -
- ); + return ( + + + navigate("/profile")}>User Profile + navigate("/profile#scores")}>Scores + navigate("/upload")}>Upload Resume + Coordinator Dashboard + + +

Welcome, {user?.email.toUpperCase()}

+

Select an option from the sidebar.

+
+ navigate("/profile")} /> +
+ ); }; export default Dashboard; diff --git a/src/pages/SignUp.jsx b/src/pages/SignUp.jsx index 6cba3a7..d5e8050 100644 --- a/src/pages/SignUp.jsx +++ b/src/pages/SignUp.jsx @@ -3,6 +3,7 @@ import { auth, sendSignInLinkToEmail } from "../firebase"; import styled from "styled-components"; import { theme } from "../styles/theme"; + const Container = styled.div` display: flex; flex-direction: column; @@ -48,45 +49,45 @@ const Button = styled.button` `; const SignUp = () => { - const [rollNumber, setRollNumber] = useState(""); - const [name, setName] = useState(""); - const [loading, setLoading] = useState(false); - //const navigate = useNavigate(); - - const handleSignUp = async () => { - if (!rollNumber || !name) { - alert("Please enter your Roll Number and Name"); - return; - } + const [rollNumber, setRollNumber] = useState(""); + const [name, setName] = useState(""); + const [loading, setLoading] = useState(false); + //const navigate = useNavigate(); - const email = `${rollNumber}@nitrkl.ac.in`; - const actionCodeSettings = { - url: "http://localhost:5173/login", - handleCodeInApp: true, - }; + const handleSignUp = async () => { + if (!rollNumber || !name) { + alert("Please enter your Roll Number and Name"); + return; + } - setLoading(true); - try { - await sendSignInLinkToEmail(auth, email, actionCodeSettings); - window.localStorage.setItem("emailForSignIn", email); - alert(`Verification link sent to ${email}. Check your email.`); - } catch (error) { - console.error("Error sending email:", error); - alert("Failed to send verification link."); - } - setLoading(false); + const email = `${rollNumber}@nitrkl.ac.in`; + const actionCodeSettings = { + url: "http://localhost:5173/login", + handleCodeInApp: true, }; - return ( - - -

Sign Up

- setRollNumber(e.target.value)} /> - setName(e.target.value)} /> - -
-
- ); + setLoading(true); + try { + await sendSignInLinkToEmail(auth, email, actionCodeSettings); + window.localStorage.setItem("emailForSignIn", email); + alert(`Verification link sent to ${email}. Check your email.`); + } catch (error) { + console.error("Error sending email:", error); + alert("Failed to send verification link."); + } + setLoading(false); + }; + + return ( + + +

Sign Up

+ setRollNumber(e.target.value)} /> + setName(e.target.value)} /> + +
+
+ ); }; export default SignUp;