1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-14 23:30:05 +02:00

fix(cp-frontend): Pass full paths to menu items

This commit is contained in:
JUDIT GRESKOVITS 2017-07-13 14:21:31 +01:00 committed by Sérgio Ramos
parent 1533bf5d6e
commit fe760dcca6

View File

@ -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 ? <MenuComponent links={sections} /> : 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 <MenuComponent links={sectionsWithPathnames} /> ;
}
const ConnectedMenu = connect(
(state, ownProps) => {