diff --git a/public/components/navigation/Menu.jsx b/public/components/navigation/Menu.jsx index c943cf9..305d036 100644 --- a/public/components/navigation/Menu.jsx +++ b/public/components/navigation/Menu.jsx @@ -14,7 +14,18 @@ import React from 'react'; import FontAwesomeIcon from '@fortawesome/react-fontawesome' import { NavLink } from 'react-router-dom'; import { faBars } from '@fortawesome/fontawesome-free-solid' +import { connect } from 'react-redux'; +import Language from './../../language/Language'; +const MenuItems = { + "navbar.contact.title": { + "navbar.contact.about": "/about", + "navbar.contact.contact": "/contact" + }, + "navbar.legal.title": { + "navbar.legal.privacy": "/privacy-policy" + } +} const MenuGroup = function(props) { return ( @@ -27,7 +38,7 @@ const MenuGroup = function(props) { const MenuItem = function(props) { return ( - + {props.children} ) @@ -48,6 +59,18 @@ class Menu extends React.Component { }); } + openMenu() { + this.setState({ + open: true + }); + } + + closeMenu() { + this.setState({ + open: false + }) + } + render() { if(this.state.open) { document.body.classList.add('is-menu-open'); @@ -55,6 +78,23 @@ class Menu extends React.Component { document.body.classList.remove('is-menu-open'); } + let menu = []; + let keys = Object.keys(MenuItems); + for(var i = 0; i < keys.length; i++) { + let k = keys[i]; + let sKeys = Object.keys(MenuItems[k]); + let menuItems = []; + for(var x = 0; x < sKeys.length; x++) { + let sKey = sKeys[x]; + console.log(sKey); + menuItems.push({Language.get(sKey)}) + } + menu.push( + + {menuItems} + + ); + } return (