mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-22 17:10:26 +03:00
Fixed siude menu active element not being properly selected
This commit is contained in:
parent
3ea33d0e38
commit
fb407da3e8
1 changed files with 6 additions and 1 deletions
|
@ -4,6 +4,11 @@ import './AsideMenu.scss';
|
|||
|
||||
export default function AsideMenu({ selectedServer }) {
|
||||
const serverId = selectedServer ? selectedServer.id : '';
|
||||
const isListShortUrlsActive = (match, { pathname }) => {
|
||||
// FIXME. Should use the 'match' params, but they are not being properly resolved. Investigate
|
||||
const serverIdFromPathname = pathname.split('/')[2];
|
||||
return serverIdFromPathname === serverId && pathname.indexOf('list-short-urls') !== -1;
|
||||
};
|
||||
|
||||
return (
|
||||
<aside className="aside-menu col-md-2 col-sm-2">
|
||||
|
@ -12,7 +17,7 @@ export default function AsideMenu({ selectedServer }) {
|
|||
className="aside-menu__item"
|
||||
activeClassName="aside-menu__item--selected"
|
||||
to={`/server/${serverId}/list-short-urls/1`}
|
||||
isActive={match => match && match.params.serverId === serverId}
|
||||
isActive={isListShortUrlsActive}
|
||||
>
|
||||
List short URLs
|
||||
</NavLink>
|
||||
|
|
Loading…
Reference in a new issue