From 62fbed79b9cd1e70e2bb0e758689ac4ff85d824c Mon Sep 17 00:00:00 2001 From: jeffvli Date: Fri, 14 Jan 2022 07:57:34 -0800 Subject: [PATCH] Add song list routes --- src/components/layout/Layout.tsx | 3 +++ src/components/layout/Sidebar.tsx | 32 +++++++++++++++++-------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index 800d5aa..afe0d88 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -75,6 +75,9 @@ const Layout = ({ footer, children, disableSidebar, font }: any) => { case 'albums': route = '/library/album'; break; + case 'music': + route = '/library/music'; + break; case 'artists': route = '/library/artist'; break; diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index 063633c..1ea584a 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; import { Sidenav, Nav, Icon } from 'rsuite'; import { useAppSelector } from '../../redux/hooks'; +import { Server } from '../../types'; import { FixedSidebar, SidebarNavItem } from './styled'; const Sidebar = ({ @@ -14,6 +15,7 @@ const Sidebar = ({ ...rest }: any) => { const history = useHistory(); + const config = useAppSelector((state) => state.config); return ( Favorites - } - onSelect={handleSidebarSelect} - disabled={disableSidebar} - onKeyDown={(e: any) => { - if (e.key === ' ' || e.key === 'Enter') { - history.push('/library/song'); - } - }} - > - Songs - + {config.serverType === Server.Jellyfin && ( + } + onSelect={handleSidebarSelect} + disabled={disableSidebar} + onKeyDown={(e: any) => { + if (e.key === ' ' || e.key === 'Enter') { + history.push('/library/music'); + } + }} + > + Songs + + )}