From 86eb963176f9fc523881bda5c37893120c9746de Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 12 Aug 2018 08:26:36 +0200 Subject: [PATCH] Simplified AsideMenu component removing unneeded checks --- src/common/AsideMenu.js | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/common/AsideMenu.js b/src/common/AsideMenu.js index a098d4cf..e9fa832f 100644 --- a/src/common/AsideMenu.js +++ b/src/common/AsideMenu.js @@ -1,18 +1,13 @@ -import listIcon from '@fortawesome/fontawesome-free-solid/faBars'; -import createIcon from '@fortawesome/fontawesome-free-solid/faPlus'; -import FontAwesomeIcon from '@fortawesome/react-fontawesome'; -import React from 'react'; -import { NavLink } from 'react-router-dom'; -import DeleteServerButton from '../servers/DeleteServerButton'; -import './AsideMenu.scss'; +import listIcon from '@fortawesome/fontawesome-free-solid/faBars' +import createIcon from '@fortawesome/fontawesome-free-solid/faPlus' +import FontAwesomeIcon from '@fortawesome/react-fontawesome' +import React from 'react' +import { NavLink } from 'react-router-dom' +import DeleteServerButton from '../servers/DeleteServerButton' +import './AsideMenu.scss' export default function AsideMenu({ selectedServer, history }) { 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 (