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 */}
+
+
);
}
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 (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
-}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};