mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Convert CardView to react
This commit is contained in:
parent
9efc71fa3b
commit
97472ac8bb
20 changed files with 1993 additions and 11 deletions
50
src/components/cardbuilder/Card/CardContent.tsx
Normal file
50
src/components/cardbuilder/Card/CardContent.tsx
Normal file
|
@ -0,0 +1,50 @@
|
|||
import React, { FC } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { getDefaultBackgroundClass } from '../cardBuilderUtils';
|
||||
import CardImageContainer from './CardImageContainer';
|
||||
|
||||
import type { ItemDto } from 'types/itemDto';
|
||||
import type { CardOptions } from 'types/cardOptions';
|
||||
|
||||
interface CardContentProps {
|
||||
item: ItemDto;
|
||||
cardOptions: CardOptions;
|
||||
coveredImage: boolean;
|
||||
overlayText: boolean | undefined;
|
||||
imgUrl: string | undefined;
|
||||
blurhash: string | undefined;
|
||||
forceName: boolean;
|
||||
}
|
||||
|
||||
const CardContent: FC<CardContentProps> = ({
|
||||
item,
|
||||
cardOptions,
|
||||
coveredImage,
|
||||
overlayText,
|
||||
imgUrl,
|
||||
blurhash,
|
||||
forceName
|
||||
}) => {
|
||||
const cardContentClass = classNames(
|
||||
'cardContent',
|
||||
{ [getDefaultBackgroundClass(item.Name)]: !imgUrl }
|
||||
);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`${cardContentClass}`}
|
||||
>
|
||||
<CardImageContainer
|
||||
item={item}
|
||||
cardOptions={cardOptions}
|
||||
coveredImage={coveredImage}
|
||||
overlayText={overlayText}
|
||||
imgUrl={imgUrl}
|
||||
blurhash={blurhash}
|
||||
forceName={forceName}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default CardContent;
|
Loading…
Add table
Add a link
Reference in a new issue