mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix toolbar safe are in experimental layout
This commit is contained in:
parent
2689c51b84
commit
5a7a859b01
2 changed files with 16 additions and 0 deletions
|
@ -46,6 +46,7 @@ const VideoPage: FC = () => {
|
||||||
<AppToolbar
|
<AppToolbar
|
||||||
isDrawerAvailable={false}
|
isDrawerAvailable={false}
|
||||||
isDrawerOpen={false}
|
isDrawerOpen={false}
|
||||||
|
isFullscreen
|
||||||
isUserMenuAvailable={false}
|
isUserMenuAvailable={false}
|
||||||
buttons={
|
buttons={
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -17,6 +17,7 @@ interface AppToolbarProps {
|
||||||
isDrawerAvailable: boolean
|
isDrawerAvailable: boolean
|
||||||
isDrawerOpen: boolean
|
isDrawerOpen: boolean
|
||||||
onDrawerButtonClick?: (event: React.MouseEvent<HTMLElement>) => void,
|
onDrawerButtonClick?: (event: React.MouseEvent<HTMLElement>) => void,
|
||||||
|
isFullscreen?: boolean,
|
||||||
isUserMenuAvailable?: boolean
|
isUserMenuAvailable?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ const AppToolbar: FC<PropsWithChildren<AppToolbarProps>> = ({
|
||||||
isDrawerAvailable,
|
isDrawerAvailable,
|
||||||
isDrawerOpen,
|
isDrawerOpen,
|
||||||
onDrawerButtonClick = () => { /* no-op */ },
|
onDrawerButtonClick = () => { /* no-op */ },
|
||||||
|
isFullscreen = false,
|
||||||
isUserMenuAvailable = true
|
isUserMenuAvailable = true
|
||||||
}) => {
|
}) => {
|
||||||
const { user } = useApi();
|
const { user } = useApi();
|
||||||
|
@ -40,6 +42,9 @@ const AppToolbar: FC<PropsWithChildren<AppToolbarProps>> = ({
|
||||||
|
|
||||||
const isBackButtonAvailable = appRouter.canGoBack();
|
const isBackButtonAvailable = appRouter.canGoBack();
|
||||||
|
|
||||||
|
// Only use the left safe area padding when the drawer is not pinned or in a fullscreen view
|
||||||
|
const useSafeAreaLeft = isDrawerAvailable || isFullscreen;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Toolbar
|
<Toolbar
|
||||||
variant='dense'
|
variant='dense'
|
||||||
|
@ -47,6 +52,16 @@ const AppToolbar: FC<PropsWithChildren<AppToolbarProps>> = ({
|
||||||
flexWrap: {
|
flexWrap: {
|
||||||
xs: 'wrap',
|
xs: 'wrap',
|
||||||
lg: 'nowrap'
|
lg: 'nowrap'
|
||||||
|
},
|
||||||
|
...(useSafeAreaLeft && {
|
||||||
|
pl: {
|
||||||
|
xs: 'max(16px, env(safe-area-inset-left))',
|
||||||
|
sm: 'max(24px, env(safe-area-inset-left))'
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
pr: {
|
||||||
|
xs: 'max(16px, env(safe-area-inset-left))',
|
||||||
|
sm: 'max(24px, env(safe-area-inset-left))'
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue