diff --git a/src/common/AsideMenu.tsx b/src/common/AsideMenu.tsx index abd87866..bdbc3f14 100644 --- a/src/common/AsideMenu.tsx +++ b/src/common/AsideMenu.tsx @@ -10,12 +10,10 @@ import classNames from 'classnames'; import type { FC } from 'react'; import type { NavLinkProps } from 'react-router-dom'; import { NavLink, useLocation } from 'react-router-dom'; -import type { SelectedServer } from '../servers/data'; -import { isServerWithId } from '../servers/data'; import './AsideMenu.scss'; export interface AsideMenuProps { - selectedServer: SelectedServer; + routePrefix: string; showOnMobile?: boolean; } @@ -34,14 +32,12 @@ const AsideMenuItem: FC = ({ children, to, className, ...res ); -export const AsideMenu: FC = ({ selectedServer, showOnMobile = false }) => { - const hasId = isServerWithId(selectedServer); - const serverId = hasId ? selectedServer.id : ''; +export const AsideMenu: FC = ({ routePrefix, showOnMobile = false }) => { const { pathname } = useLocation(); const asideClass = classNames('aside-menu', { 'aside-menu--hidden': !showOnMobile, }); - const buildPath = (suffix: string) => `/server/${serverId}${suffix}`; + const buildPath = (suffix: string) => `${routePrefix}${suffix}`; return (