diff --git a/src/components/header.js b/src/components/header.js index 5a6526e..9ffd63e 100644 --- a/src/components/header.js +++ b/src/components/header.js @@ -16,7 +16,7 @@ const NavLink = ({ partial=true, ...props}) => ( : isCurrent; return { style: { - color: isActive ? "white" : "" + color: isActive ? "white" : "", } }; }} @@ -25,12 +25,8 @@ const NavLink = ({ partial=true, ...props}) => ( const Header = ( ) => { const { location } = history; - var active; - if (location.pathname === "/projects/physics" || - location.pathname === "/projects/education" || - location.pathname === "/projects/math" || - location.pathname === "/projects/software") - { active = "active" } + var activePrj = location.pathname.includes('/projects') ? 'active': ''; + var activeNews = location.pathname.includes('/news') ? 'active': ''; return(
@@ -39,8 +35,9 @@ const Header = ( ) => {