From e5faba9df52a4515f5a9137c0699d1fe236ec0e8 Mon Sep 17 00:00:00 2001 From: NicBG Date: Wed, 3 Apr 2024 14:09:54 -0500 Subject: [PATCH] fixed css navbar --- lvlgg_frontend/src/Components/Navbar.css | 33 +++++++++------------- lvlgg_frontend/src/Contexts/AuthContext.js | 5 +--- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/lvlgg_frontend/src/Components/Navbar.css b/lvlgg_frontend/src/Components/Navbar.css index 0d04896..cfd6548 100644 --- a/lvlgg_frontend/src/Components/Navbar.css +++ b/lvlgg_frontend/src/Components/Navbar.css @@ -1,30 +1,31 @@ .navbar { background: linear-gradient(90deg, #060f1b 0%, #080808 100%); - height: 50px; + height: 5.5%; display: flex; justify-content: center; align-items: center; font-size: 1rem; position: fixed; - top: 0; + top: 0%; width: 100%; z-index: 40; } .navbar-container { display: flex; - justify-content: center; + justify-content: space-between; align-items: center; height: 80px; - max-width: 1500px; + margin-right: 10%; + width:100%; } .navbar-logo { color: #3bf5f5; justify-self: start; - margin-left: 0px; cursor: pointer; text-decoration: none; + margin-left: 14%; font-size: 1.8rem; display: flex; align-items: center; @@ -44,7 +45,7 @@ text-align: center; width: 60vw; justify-content: end; - margin-right: 1.5rem; + margin-right: 5%; } .nav-item { @@ -150,28 +151,23 @@ .username { position: relative; - top: 2px; - right: -150px; + margin-top: 0.2%; + right: -10%; color: #ffffff; font-size: 16px; font-weight: bold; } -.navbar-container { - display: flex; - justify-content: space-between; - align-items: center; -} .favorites-dropdown { position: absolute; - margin-left: -14vw; - margin-top: 1vh; + margin-left: 1%; + margin-top: 0.5%; z-index: 1000; transition: margin-left 0.5s ease; } .favorites-dropdown.open { - margin-left: -12vw; + margin-left: 2%; } .favorites-dropdown button { @@ -222,9 +218,8 @@ height: 50px; background-color: #333; border-radius: 50%; - margin-top:4vh; - margin-bottom: 10px; - margin-left: 27%; + margin-top:33%; + margin-left: 33%; cursor: pointer; position: relative; box-shadow: 0 6px 20px rgb(255, 255, 255); diff --git a/lvlgg_frontend/src/Contexts/AuthContext.js b/lvlgg_frontend/src/Contexts/AuthContext.js index 105e8b1..15b8c14 100644 --- a/lvlgg_frontend/src/Contexts/AuthContext.js +++ b/lvlgg_frontend/src/Contexts/AuthContext.js @@ -5,22 +5,19 @@ const AuthContext = createContext(); const AuthProvider = ({ children }) => { const [isSignedIn, setIsSignedIn] = useState(() => { - // Initialize isSignedIn from local storage, defaulting to false + return localStorage.getItem('isSignedIn') === 'true'; }); const [userPk, setUserPk] = useState(() => { - // Initialize userPk from local storage, defaulting to null return localStorage.getItem('userPk'); }); useEffect(() => { - // Update local storage when isSignedIn changes localStorage.setItem('isSignedIn', isSignedIn); }, [isSignedIn]); useEffect(() => { - // Update local storage when userPk changes localStorage.setItem('userPk', userPk); }, [userPk]);