Move language switch to the right
This commit is contained in:
parent
bb3bc967d8
commit
27ccf06573
@ -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,
|
||||
|
@ -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 = () => {
|
||||
<Nav.Link as="span" eventKey="about"><FormattedMessage
|
||||
id="header.group"/></Nav.Link>
|
||||
</Link>
|
||||
<Link to={`/${intl.locale}/projects/physics`} className="nav-item" activeClassName="active"
|
||||
partiallyActive={true}>
|
||||
<Link to={`/${intl.locale}/projects/physics`} className={projectsLinkStyle}>
|
||||
{/* projects */}
|
||||
<Nav.Link as="span" eventKey="projects">
|
||||
<FormattedMessage id="header.projects"/>
|
||||
@ -55,10 +49,10 @@ const CustomNavbar = () => {
|
||||
<Nav.Link as="span" eventKey="partners"><FormattedMessage
|
||||
id="header.partners"/></Nav.Link>
|
||||
</Link>
|
||||
<Nav.Link eventKey="language" className="language">
|
||||
<Language/>
|
||||
</Nav.Link>
|
||||
</Nav>
|
||||
<Nav.Link eventKey="language" className="nav-item language">
|
||||
<Language/>
|
||||
</Nav.Link>
|
||||
</Navbar.Collapse>
|
||||
</Container>
|
||||
</Navbar>
|
||||
|
Loading…
Reference in New Issue
Block a user