fixed submenu navlinks

This commit is contained in:
Florian Scholdei
2019-01-18 14:32:35 +01:00
parent de381f7673
commit c6b43ec460
4 changed files with 10 additions and 4 deletions

View File

@@ -42,8 +42,14 @@ class SubNavigation extends React.Component<Props> {
render() {
const { to, activeOnlyWhenExact } = this.props;
// removes last part of url
let parents = to.split("/");
parents.splice(-1,1);
let parent = parents.join("/");
return (
<Route path={to} exact={activeOnlyWhenExact} children={this.renderLink} />
<Route path={parent} exact={activeOnlyWhenExact} children={this.renderLink} />
);
}
}