Add song list routes

This commit is contained in:
jeffvli
2022-01-14 07:57:34 -08:00
committed by Jeff
parent b2dc5030fc
commit 62fbed79b9
2 changed files with 21 additions and 14 deletions

View File

@@ -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;

View File

@@ -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 (
<FixedSidebar
@@ -90,20 +92,22 @@ const Sidebar = ({
>
Favorites
</SidebarNavItem>
<SidebarNavItem
tabIndex={0}
eventKey="songs"
icon={<Icon icon="music" />}
onSelect={handleSidebarSelect}
disabled={disableSidebar}
onKeyDown={(e: any) => {
if (e.key === ' ' || e.key === 'Enter') {
history.push('/library/song');
}
}}
>
Songs
</SidebarNavItem>
{config.serverType === Server.Jellyfin && (
<SidebarNavItem
tabIndex={0}
eventKey="music"
icon={<Icon icon="music" />}
onSelect={handleSidebarSelect}
disabled={disableSidebar}
onKeyDown={(e: any) => {
if (e.key === ' ' || e.key === 'Enter') {
history.push('/library/music');
}
}}
>
Songs
</SidebarNavItem>
)}
<SidebarNavItem
tabIndex={0}
eventKey="albums"