1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix drawer showing on all pages and item details padding

This commit is contained in:
Bill Thornton 2024-01-04 01:13:28 -05:00
parent 4e7f0136f7
commit b08b8656e9
3 changed files with 19 additions and 11 deletions

View file

@ -27,9 +27,9 @@ const AppLayout: FC<AppLayoutProps> = ({
const { user } = useApi();
const isSmallScreen = useMediaQuery((t: Theme) => t.breakpoints.up('sm'));
const isDrawerAvailable = !isSmallScreen
const isDrawerAvailable = Boolean(user)
&& !drawerlessPaths.some(path => location.pathname.startsWith(`/${path}`));
const isDrawerOpen = isDrawerActive && isDrawerAvailable && Boolean(user);
const isDrawerOpen = isDrawerActive && isDrawerAvailable;
const onToggleDrawer = useCallback(() => {
setIsDrawerActive(!isDrawerActive);
@ -52,18 +52,22 @@ const AppLayout: FC<AppLayoutProps> = ({
}}
>
<AppToolbar
isDrawerAvailable={isDrawerAvailable}
isDrawerAvailable={!isSmallScreen && isDrawerAvailable}
isDrawerOpen={isDrawerOpen}
onDrawerButtonClick={onToggleDrawer}
/>
</AppBar>
</ElevationScroll>
<AppDrawer
open={isDrawerOpen}
onClose={onToggleDrawer}
onOpen={onToggleDrawer}
/>
{
isDrawerAvailable && (
<AppDrawer
open={isDrawerOpen}
onClose={onToggleDrawer}
onOpen={onToggleDrawer}
/>
)
}
<Box
component='main'

View file

@ -53,7 +53,7 @@ const AppLayout = () => {
</ElevationScroll>
{
user && (
isDrawerAvailable && (
<AppDrawer
open={isDrawerOpen}
onClose={onToggleDrawer}

View file

@ -21,10 +21,14 @@ $mui-bp-xl: 1536px;
// Fix the padding of some pages
.homePage.libraryPage.withTabs, // Home page
.libraryPage:not(.withTabs) { // Tabless library pages
// Library pages excluding the item details page and tabbed pages
.libraryPage:not(
.itemDetailPage,
.withTabs
) {
padding-top: 3.25rem !important;
}
// Tabbed library pages
.libraryPage.withTabs {
padding-top: 6.5rem !important;