mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #5270 from grafixeyehero/Fix-card
This commit is contained in:
commit
1196ae992f
2 changed files with 14 additions and 13 deletions
|
@ -5,6 +5,7 @@ import layoutManager from 'components/layoutManager';
|
||||||
import MoreVertIconButton from '../../common/MoreVertIconButton';
|
import MoreVertIconButton from '../../common/MoreVertIconButton';
|
||||||
import type { ItemDto } from 'types/base/models/item-dto';
|
import type { ItemDto } from 'types/base/models/item-dto';
|
||||||
import type { CardOptions } from 'types/cardOptions';
|
import type { CardOptions } from 'types/cardOptions';
|
||||||
|
import Image from 'components/common/Image';
|
||||||
|
|
||||||
const shouldShowDetailsMenu = (
|
const shouldShowDetailsMenu = (
|
||||||
cardOptions: CardOptions,
|
cardOptions: CardOptions,
|
||||||
|
@ -23,9 +24,14 @@ interface LogoComponentProps {
|
||||||
logoUrl: string;
|
logoUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LogoComponent: FC<LogoComponentProps> = ({ logoUrl }) => {
|
const LogoComponent: FC<LogoComponentProps> = ({ logoUrl }) => (
|
||||||
return <Box className='lazy cardFooterLogo' data-src={logoUrl} />;
|
<Box className='cardFooterLogo'>
|
||||||
};
|
<Image
|
||||||
|
imgUrl={logoUrl}
|
||||||
|
containImage
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
|
||||||
interface CardFooterTextProps {
|
interface CardFooterTextProps {
|
||||||
item: ItemDto;
|
item: ItemDto;
|
||||||
|
@ -51,7 +57,7 @@ const CardFooterText: FC<CardFooterTextProps> = ({
|
||||||
isOuterFooter
|
isOuterFooter
|
||||||
}) => {
|
}) => {
|
||||||
const { cardTextLines } = useCardText({
|
const { cardTextLines } = useCardText({
|
||||||
item,
|
item: item.ProgramInfo || item,
|
||||||
cardOptions,
|
cardOptions,
|
||||||
forceName,
|
forceName,
|
||||||
imgUrl,
|
imgUrl,
|
||||||
|
|
|
@ -6,7 +6,6 @@ import {
|
||||||
} from '@jellyfin/sdk/lib/generated-client';
|
} from '@jellyfin/sdk/lib/generated-client';
|
||||||
import { Api } from '@jellyfin/sdk';
|
import { Api } from '@jellyfin/sdk';
|
||||||
import { getImageApi } from '@jellyfin/sdk/lib/utils/api/image-api';
|
import { getImageApi } from '@jellyfin/sdk/lib/utils/api/image-api';
|
||||||
import escapeHTML from 'escape-html';
|
|
||||||
|
|
||||||
import { appRouter } from 'components/router/appRouter';
|
import { appRouter } from 'components/router/appRouter';
|
||||||
import layoutManager from 'components/layoutManager';
|
import layoutManager from 'components/layoutManager';
|
||||||
|
@ -78,15 +77,11 @@ export function getTextActionButton(
|
||||||
text?: NullableString,
|
text?: NullableString,
|
||||||
serverId?: NullableString
|
serverId?: NullableString
|
||||||
): TextLine {
|
): TextLine {
|
||||||
if (!text) {
|
const title = text || itemHelper.getDisplayName(item);
|
||||||
text = itemHelper.getDisplayName(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
text = escapeHTML(text);
|
|
||||||
|
|
||||||
if (layoutManager.tv) {
|
if (layoutManager.tv) {
|
||||||
return {
|
return {
|
||||||
title: text
|
title
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +103,7 @@ export function getTextActionButton(
|
||||||
return {
|
return {
|
||||||
titleAction: {
|
titleAction: {
|
||||||
url,
|
url,
|
||||||
title: text,
|
title,
|
||||||
dataAttributes
|
dataAttributes
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -510,7 +505,7 @@ function getChannelName(item: ItemDto) {
|
||||||
item.ChannelName
|
item.ChannelName
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return { title: item.ChannelName || '' || ' ' };
|
return { title: item.ChannelName || '\u00A0' };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue