mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #4922 from grafixeyehero/Fix-hide-AppTabs
Hide AppTabs component if path has no tab.
This commit is contained in:
commit
c0eade7e55
1 changed files with 3 additions and 1 deletions
|
@ -11,6 +11,7 @@ import AppTabs from '../tabs/AppTabs';
|
||||||
import { isDrawerPath } from '../drawers/AppDrawer';
|
import { isDrawerPath } from '../drawers/AppDrawer';
|
||||||
import RemotePlayButton from './RemotePlayButton';
|
import RemotePlayButton from './RemotePlayButton';
|
||||||
import SyncPlayButton from './SyncPlayButton';
|
import SyncPlayButton from './SyncPlayButton';
|
||||||
|
import { isTabPath } from '../tabs/tabRoutes';
|
||||||
|
|
||||||
interface AppToolbarProps {
|
interface AppToolbarProps {
|
||||||
isDrawerOpen: boolean
|
isDrawerOpen: boolean
|
||||||
|
@ -23,6 +24,7 @@ const ExperimentalAppToolbar: FC<AppToolbarProps> = ({
|
||||||
}) => {
|
}) => {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const isDrawerAvailable = isDrawerPath(location.pathname);
|
const isDrawerAvailable = isDrawerPath(location.pathname);
|
||||||
|
const isTabsAvailable = isTabPath(location.pathname);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppToolbar
|
<AppToolbar
|
||||||
|
@ -48,7 +50,7 @@ const ExperimentalAppToolbar: FC<AppToolbarProps> = ({
|
||||||
isDrawerOpen={isDrawerOpen}
|
isDrawerOpen={isDrawerOpen}
|
||||||
onDrawerButtonClick={onDrawerButtonClick}
|
onDrawerButtonClick={onDrawerButtonClick}
|
||||||
>
|
>
|
||||||
<AppTabs isDrawerOpen={isDrawerOpen} />
|
{isTabsAvailable && (<AppTabs isDrawerOpen={isDrawerOpen} />)}
|
||||||
</AppToolbar>
|
</AppToolbar>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue