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 0b20a3b..d5e8050 100644 --- a/src/pages/SignUp.jsx +++ b/src/pages/SignUp.jsx @@ -1,9 +1,9 @@ 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"; + const Container = styled.div` display: flex; flex-direction: column; @@ -49,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;