From 27ccf0657303a237ed34b074999bd3d87be608c8 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 26 Mar 2021 21:30:32 +0300 Subject: [PATCH] Move language switch to the right --- src/components/language.js | 2 +- src/components/navBar.js | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/components/language.js b/src/components/language.js index 05e42a2..68d9fde 100644 --- a/src/components/language.js +++ b/src/components/language.js @@ -17,7 +17,7 @@ const Language = () => { key={language} onClick={() => changeLocale(language)} style={{ - color: currentLocale === language ? `white` : `rgb(170,172,173)`, + color: currentLocale === language ? `white` : `rgb(170, 172, 173)`, backgroundColor: currentLocale === language ? `#db4446` : ``, marginLeft: -11, margin: 10, diff --git a/src/components/navBar.js b/src/components/navBar.js index 7495085..d6ca212 100644 --- a/src/components/navBar.js +++ b/src/components/navBar.js @@ -11,15 +11,10 @@ import logo from "../images/index/logo_white.png" const CustomNavbar = () => { const intl = useIntl(); - const {location} = history; - //let active = ["", "", "", ""] - // active[0] = location.pathname.includes('/news/') ? 'active' : "link-no-style"; - // active[1] = location.pathname.includes('/about/') ? 'active' : "link-no-style"; - // active[2] = location.pathname.includes('/projects/') ? 'active' : "link-no-style"; - // active[3] = location.pathname.includes('/partners/') ? 'active' : "link-no-style"; let activeBrand = location.pathname === "/ru/" || location.pathname === "/en/" ? 'activeBrand' : "link-no-style"; + let projectsLinkStyle = location.pathname.startsWith(`/${intl.locale}/projects`) ? "nav-item active" : "nav-item" return ( <> @@ -42,8 +37,7 @@ const CustomNavbar = () => { - + {/* projects */} @@ -55,10 +49,10 @@ const CustomNavbar = () => { - - - + + +