Add lang to HamburgerMenuLink

This commit is contained in:
2018-06-19 06:46:34 +10:00
parent 07aa74f359
commit aafc15402d

View File

@ -24,13 +24,15 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { NavLink } from 'react-router-dom'; import { NavLink } from 'react-router-dom';
import Language from './../../language/Language';
import * as MenuActions from './../../actions/MenuActions'; import * as MenuActions from './../../actions/MenuActions';
const HamburerMenuItem = function(props) { const HamburerMenuItem = function(props) {
console.log(props);
return ( return (
<li className="o-hamburger-menu__link"> <li className="o-hamburger-menu__link">
<NavLink to={ props.to } className="o-hamburger-menu__link-link"> <NavLink to={ props.to } className="o-hamburger-menu__link-link">
Home { Language.get(props.lang) }
</NavLink> </NavLink>
</li> </li>
); );
@ -61,9 +63,9 @@ class HamburgerMenu extends React.Component {
<div className="o-hamburger-menu__menu"> <div className="o-hamburger-menu__menu">
<ul className="o-hamburger-menu__links"> <ul className="o-hamburger-menu__links">
<HamburerMenuItem to="/" /> <HamburerMenuItem to="/" lang="navbar.home" />
<HamburerMenuItem to="/" /> <HamburerMenuItem to="/about" lang="navbar.about" />
<HamburerMenuItem to="/" /> <HamburerMenuItem to="/contact" lang="navbar.contact" />
</ul> </ul>
</div> </div>
</div> </div>
@ -74,7 +76,8 @@ class HamburgerMenu extends React.Component {
const mapStateToProps = function(state) { const mapStateToProps = function(state) {
return { return {
open: state.menu.open open: state.menu.open,
language: state.language.code
} }
} }