From 171f3dc52d9f6b45d7fb6ae33a3cf1bdf8e395e6 Mon Sep 17 00:00:00 2001 From: Jashwanth-rit <158207370+Jashwanth-rit@users.noreply.github.com> Date: Sun, 20 Oct 2024 21:30:06 +0530 Subject: [PATCH 1/2] jashwanth/navlogin --- client/src/components/Navbar.jsx | 26 +++-- client/src/components/ReviewDetails.jsx | 2 +- client/src/components/StepOne.jsx | 138 +++++++++++++----------- 3 files changed, 94 insertions(+), 72 deletions(-) diff --git a/client/src/components/Navbar.jsx b/client/src/components/Navbar.jsx index 9791d499..067e0aeb 100644 --- a/client/src/components/Navbar.jsx +++ b/client/src/components/Navbar.jsx @@ -258,6 +258,12 @@ const Navbar = ({ isAuthenticated, user, handleLogout }) => {

Home

+ + + +

Profile

+
+ {
- {localStorage?.getItem('token') ? ( - + {localStorage?.getItem('basicDetails') ? ( + <> + + ) : (
{ e.preventDefault(); @@ -91,23 +90,29 @@ function StepOne() { })); return; } - nextStep(); + + // Store basicDetails in localStorage + localStorage.setItem('basicDetails', JSON.stringify(basicDetails)); + + nextStep(); // Move to the next step }; return ( <>
@@ -115,10 +120,11 @@ function StepOne() { name="type" value={basicDetails.type} onChange={handleChange} - className={`${dark === 'dark' - ? 'bg-gray-800 text-yellow-400 border-yellow-400' - : 'bg-white text-gray-700 border-gray-300' - }`} + className={`${ + dark === 'dark' + ? 'bg-gray-800 text-yellow-400 border-yellow-400' + : 'bg-white text-gray-700 border-gray-300' + }`} > @@ -128,10 +134,11 @@ function StepOne() {