From 51c55d56c839e1b3ad4943100e89d203c3f59d1f Mon Sep 17 00:00:00 2001 From: Elinorre Date: Sun, 16 Feb 2020 20:40:41 +0300 Subject: [PATCH] header partial paths styling --- src/components/header.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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 = ( ) => {