From fe760dcca64cf325814fbabe006be3295affbed5 Mon Sep 17 00:00:00 2001 From: JUDIT GRESKOVITS Date: Thu, 13 Jul 2017 14:21:31 +0100 Subject: [PATCH] fix(cp-frontend): Pass full paths to menu items --- .../cp-frontend/src/containers/navigation/menu.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/cp-frontend/src/containers/navigation/menu.js b/packages/cp-frontend/src/containers/navigation/menu.js index 2186bdf6..df224fcd 100644 --- a/packages/cp-frontend/src/containers/navigation/menu.js +++ b/packages/cp-frontend/src/containers/navigation/menu.js @@ -2,8 +2,19 @@ import React from 'react'; import { connect } from 'react-redux'; import { Menu as MenuComponent } from '@components/navigation'; -const Menu = ({ sections }) => - sections && sections.length ? : null; +const Menu = ({match, sections}) => { + if(!sections || !sections.length) { + return null; + } + + const sectionsWithPathnames = sections.map(section => { + return { + name: section.name, + pathname: `${match.url}/${section.pathname}` + }; + }); + return ; +} const ConnectedMenu = connect( (state, ownProps) => {