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 = () => { - - - + + +