mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix navigation for mobile layout
This commit is contained in:
parent
e3b618f2fb
commit
876fbee53e
2 changed files with 13 additions and 6 deletions
|
@ -1,8 +1,8 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
import Box from '@mui/material/Box';
|
|
||||||
import ButtonGroup from '@mui/material/ButtonGroup';
|
import ButtonGroup from '@mui/material/ButtonGroup';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { appRouter } from 'components/router/appRouter';
|
||||||
|
import escapeHTML from 'escape-html';
|
||||||
import PlayArrowIconButton from '../../common/PlayArrowIconButton';
|
import PlayArrowIconButton from '../../common/PlayArrowIconButton';
|
||||||
import MoreVertIconButton from '../../common/MoreVertIconButton';
|
import MoreVertIconButton from '../../common/MoreVertIconButton';
|
||||||
|
|
||||||
|
@ -43,6 +43,10 @@ const CardOverlayButtons: FC<CardOverlayButtonsProps> = ({
|
||||||
overlayPlayButton = item.MediaType === 'Video';
|
overlayPlayButton = item.MediaType === 'Video';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const url = appRouter.getRouteUrl(item, {
|
||||||
|
parentId: cardOptions.parentId
|
||||||
|
});
|
||||||
|
|
||||||
const btnCssClass = classNames(
|
const btnCssClass = classNames(
|
||||||
'paper-icon-button-light',
|
'paper-icon-button-light',
|
||||||
'cardOverlayButton',
|
'cardOverlayButton',
|
||||||
|
@ -55,8 +59,10 @@ const CardOverlayButtons: FC<CardOverlayButtonsProps> = ({
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<a
|
||||||
sx={{
|
href={url}
|
||||||
|
aria-label={escapeHTML(item.Name)}
|
||||||
|
style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
|
@ -66,6 +72,7 @@ const CardOverlayButtons: FC<CardOverlayButtonsProps> = ({
|
||||||
borderRadius: '0.2em'
|
borderRadius: '0.2em'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
||||||
{cardOptions.centerPlayButton && (
|
{cardOptions.centerPlayButton && (
|
||||||
<PlayArrowIconButton
|
<PlayArrowIconButton
|
||||||
className={centerPlayButtonClass}
|
className={centerPlayButtonClass}
|
||||||
|
@ -89,7 +96,7 @@ const CardOverlayButtons: FC<CardOverlayButtonsProps> = ({
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</Box>
|
</a>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import type { CollectionType, UserItemDataDto } from '@jellyfin/sdk/lib/generate
|
||||||
import type { NullableBoolean, NullableNumber, NullableString } from './itemDto';
|
import type { NullableBoolean, NullableNumber, NullableString } from './itemDto';
|
||||||
|
|
||||||
export type AttributesOpts = {
|
export type AttributesOpts = {
|
||||||
context?: CollectionType | undefined,
|
context?: CollectionType,
|
||||||
parentId?: NullableString,
|
parentId?: NullableString,
|
||||||
collectionId?: NullableString,
|
collectionId?: NullableString,
|
||||||
playlistId?: NullableString,
|
playlistId?: NullableString,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue