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() { render() {
const { to, activeOnlyWhenExact } = this.props; const { to, activeOnlyWhenExact } = this.props;
// removes last part of url
let parents = to.split("/");
parents.splice(-1,1);
let parent = parents.join("/");
return ( return (
<Route path={to} exact={activeOnlyWhenExact} children={this.renderLink} /> <Route path={parent} exact={activeOnlyWhenExact} children={this.renderLink} />
); );
} }
} }

View File

@@ -76,7 +76,7 @@ class Profile extends React.Component<Props, State> {
label={t("profile.informationNavLink")} label={t("profile.informationNavLink")}
/> />
<SubNavigation <SubNavigation
to={`${url}/settings`} to={`${url}/settings/password`}
label={t("profile.settingsNavLink")} label={t("profile.settingsNavLink")}
> >
<NavLink <NavLink

View File

@@ -115,7 +115,7 @@ class SingleUser extends React.Component<Props> {
label={t("single-user.informationNavLink")} label={t("single-user.informationNavLink")}
/> />
<SubNavigation <SubNavigation
to={`${url}/settings`} to={`${url}/settings/edit`}
label={t("single-user.settingsNavLink")} label={t("single-user.settingsNavLink")}
> >
<EditUserNavLink user={user} editUrl={`${url}/settings/edit`} /> <EditUserNavLink user={user} editUrl={`${url}/settings/edit`} />

View File

@@ -253,7 +253,6 @@ $fa-font-path: "webfonts";
} }
.menu-list { .menu-list {
a { a {
border-radius: 0;
color: #333; color: #333;
padding: 1rem; padding: 1rem;
@@ -287,6 +286,7 @@ $fa-font-path: "webfonts";
} }
} }
border-radius: 0;
border-top: 1px solid #eee; border-top: 1px solid #eee;
border-left: 1px solid #eee; border-left: 1px solid #eee;
border-right: 1px solid #eee; border-right: 1px solid #eee;