mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use enums CardShape & BaseItemKind,
Use type import for react FC, Remove escapeHTML Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
parent
11d013b07e
commit
8cbddba8fd
18 changed files with 102 additions and 82 deletions
|
@ -1,3 +1,4 @@
|
|||
import { CardShape } from 'utils/card';
|
||||
import { randomInt } from '../../utils/number';
|
||||
import classNames from 'classnames';
|
||||
|
||||
|
@ -54,15 +55,15 @@ export const isResizable = (windowWidth: number): boolean => {
|
|||
*/
|
||||
export const resolveMixedShapeByAspectRatio = (primaryImageAspectRatio: number | null | undefined) => {
|
||||
if (primaryImageAspectRatio === undefined || primaryImageAspectRatio === null) {
|
||||
return 'mixedSquare';
|
||||
return CardShape.MixedSquare;
|
||||
}
|
||||
|
||||
if (primaryImageAspectRatio >= 1.33) {
|
||||
return 'mixedBackdrop';
|
||||
return CardShape.MixedBackdrop;
|
||||
} else if (primaryImageAspectRatio > 0.71) {
|
||||
return 'mixedSquare';
|
||||
return CardShape.MixedSquare;
|
||||
} else {
|
||||
return 'mixedPortrait';
|
||||
return CardShape.MixedPortrait;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue