From 7565f169db5b81999c9d655bf9bf8ccd92fabf96 Mon Sep 17 00:00:00 2001 From: siddiquiadab <80346223+adab786@users.noreply.github.com> Date: Thu, 29 Aug 2024 02:23:55 +0530 Subject: [PATCH 1/2] Update NavBar.js --- personal-portfolio/src/components/NavBar.js | 95 +++++++++++---------- 1 file changed, 51 insertions(+), 44 deletions(-) diff --git a/personal-portfolio/src/components/NavBar.js b/personal-portfolio/src/components/NavBar.js index cce00e7d5..a24a913f7 100644 --- a/personal-portfolio/src/components/NavBar.js +++ b/personal-portfolio/src/components/NavBar.js @@ -5,62 +5,69 @@ import navIcon1 from '../assets/img/nav-icon1.svg'; import navIcon2 from '../assets/img/nav-icon2.svg'; import navIcon3 from '../assets/img/nav-icon3.svg'; import { HashLink } from 'react-router-hash-link'; -import { - BrowserRouter as Router -} from "react-router-dom"; export const NavBar = () => { - const [activeLink, setActiveLink] = useState('home'); const [scrolled, setScrolled] = useState(false); useEffect(() => { const onScroll = () => { - if (window.scrollY > 50) { - setScrolled(true); - } else { - setScrolled(false); - } - } + setScrolled(window.scrollY > 50); + }; window.addEventListener("scroll", onScroll); - return () => window.removeEventListener("scroll", onScroll); - }, []) + }, []); const onUpdateActiveLink = (value) => { setActiveLink(value); - } + }; return ( - - - - - Logo - - - - - - - -
- - - -
- - - -
-
-
-
-
- ) -} + + + + Logo + + + + + + + +
+ + + +
+ + + +
+
+
+
+ ); +}; From 7168e284ffcf51e7740d7df41494f04e189b5c5a Mon Sep 17 00:00:00 2001 From: siddiquiadab <80346223+adab786@users.noreply.github.com> Date: Thu, 29 Aug 2024 02:24:59 +0530 Subject: [PATCH 2/2] Fixed #53 --- personal-portfolio/src/App.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/personal-portfolio/src/App.js b/personal-portfolio/src/App.js index fd5489b5d..55338f7b8 100644 --- a/personal-portfolio/src/App.js +++ b/personal-portfolio/src/App.js @@ -1,3 +1,4 @@ +import { BrowserRouter as Router } from "react-router-dom"; // Import Router import logo from './logo.svg'; import './App.css'; import 'bootstrap/dist/css/bootstrap.min.css'; @@ -10,14 +11,16 @@ import { Footer } from "./components/Footer"; function App() { return ( -
- - - - - -
+ {/* Wrap with Router */} +
+ + + + + +
+
); }