mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Backport pull request #5517 from jellyfin-web/release-10.9.z
Fix video osd not hiding in experimental layout
Original-merge: ea1d069e90
Merged-by: thornbill <thornbill@users.noreply.github.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
cb01afce02
commit
017734a0bb
7 changed files with 117 additions and 29 deletions
|
@ -5,7 +5,6 @@ import IconButton from '@mui/material/IconButton';
|
|||
import Toolbar from '@mui/material/Toolbar';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import React, { FC, ReactNode } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { appRouter } from 'components/router/appRouter';
|
||||
import { useApi } from 'hooks/useApi';
|
||||
|
@ -17,7 +16,8 @@ interface AppToolbarProps {
|
|||
buttons?: ReactNode
|
||||
isDrawerAvailable: boolean
|
||||
isDrawerOpen: boolean
|
||||
onDrawerButtonClick: (event: React.MouseEvent<HTMLElement>) => void
|
||||
onDrawerButtonClick?: (event: React.MouseEvent<HTMLElement>) => void,
|
||||
isUserMenuAvailable?: boolean
|
||||
}
|
||||
|
||||
const onBackButtonClick = () => {
|
||||
|
@ -32,17 +32,14 @@ const AppToolbar: FC<AppToolbarProps> = ({
|
|||
children,
|
||||
isDrawerAvailable,
|
||||
isDrawerOpen,
|
||||
onDrawerButtonClick
|
||||
onDrawerButtonClick = () => { /* no-op */ },
|
||||
isUserMenuAvailable = true
|
||||
}) => {
|
||||
const { user } = useApi();
|
||||
const isUserLoggedIn = Boolean(user);
|
||||
const currentLocation = useLocation();
|
||||
|
||||
const isBackButtonAvailable = appRouter.canGoBack();
|
||||
|
||||
// Handles a specific case to hide the user menu on the select server page while authenticated
|
||||
const isUserMenuAvailable = currentLocation.pathname !== '/selectserver.html';
|
||||
|
||||
return (
|
||||
<Toolbar
|
||||
variant='dense'
|
||||
|
@ -84,16 +81,14 @@ const AppToolbar: FC<AppToolbarProps> = ({
|
|||
|
||||
{children}
|
||||
|
||||
{isUserLoggedIn && isUserMenuAvailable && (
|
||||
<>
|
||||
<Box sx={{ display: 'flex', flexGrow: 1, justifyContent: 'flex-end' }}>
|
||||
{buttons}
|
||||
</Box>
|
||||
<Box sx={{ display: 'flex', flexGrow: 1, justifyContent: 'flex-end' }}>
|
||||
{buttons}
|
||||
</Box>
|
||||
|
||||
<Box sx={{ flexGrow: 0 }}>
|
||||
<UserMenuButton />
|
||||
</Box>
|
||||
</>
|
||||
{isUserLoggedIn && isUserMenuAvailable && (
|
||||
<Box sx={{ flexGrow: 0 }}>
|
||||
<UserMenuButton />
|
||||
</Box>
|
||||
)}
|
||||
</Toolbar>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue