fix: Fixed tests
feat: Added RClone integration feat: Implemented plugin settings feat: Updated minimal store version test: Fixed tests feat: Moved store and igdb and es-de to their own plugins
This commit is contained in:
parent
444d8c4c27
commit
c09fbd3dc8
115 changed files with 4139 additions and 1502 deletions
|
|
@ -4,6 +4,7 @@ import { JSX } from "react";
|
|||
import { twMerge } from "tailwind-merge";
|
||||
import useActiveControl from "../scripts/gamepads";
|
||||
import { oneShot } from "../scripts/audio/audio";
|
||||
import ImageWithFallbacks from "./ImageWithFallbacks";
|
||||
|
||||
export function GameCardSkeleton ()
|
||||
{
|
||||
|
|
@ -21,8 +22,8 @@ export function GameCardSkeleton ()
|
|||
export interface GameCardParams extends FocusParams
|
||||
{
|
||||
title: string;
|
||||
subtitle: string | JSX.Element;
|
||||
preview?: string | JSX.Element | ((p: { focused: boolean; }) => JSX.Element);
|
||||
subtitle?: string | JSX.Element;
|
||||
preview?: string | JSX.Element | URL[] | ((p: { focused: boolean; }) => JSX.Element);
|
||||
srcset?: string;
|
||||
focusKey: string;
|
||||
index: number;
|
||||
|
|
@ -49,6 +50,21 @@ export default function CardElement (data: GameCardParams & InteractParams)
|
|||
});
|
||||
const { isPointer } = useActiveControl();
|
||||
|
||||
let preview: any = undefined;
|
||||
if (typeof data.preview === "string")
|
||||
{
|
||||
preview = <img draggable={false} srcSet={data.srcset} className={classNames("object-cover aspect-3/4", data.previewClassName, { "animate-rotate-small": focused && !isPointer })} src={data.preview} ></img>;
|
||||
} else if (Array.isArray(data.preview))
|
||||
{
|
||||
preview = <ImageWithFallbacks src={data.preview} draggable={false} className={classNames("object-cover aspect-3/4 w-full h-full", data.previewClassName, { "animate-rotate-small": focused && !isPointer })} />;
|
||||
} else if (typeof data.preview === 'function')
|
||||
{
|
||||
preview = data.preview({ focused });
|
||||
} else
|
||||
{
|
||||
preview = data.preview;
|
||||
}
|
||||
|
||||
return (
|
||||
<li
|
||||
id={`game-entry-${data.id}`}
|
||||
|
|
@ -76,11 +92,7 @@ export default function CardElement (data: GameCardParams & InteractParams)
|
|||
focused ? "md:mt-2 md:mx-2" : "md:mt-2 md:mx-2",
|
||||
classNames({ "h-full": typeof data.preview === "string" })
|
||||
)}>
|
||||
{typeof data.preview === "string" ? (
|
||||
<img draggable={false} srcSet={data.srcset} className={classNames("object-cover aspect-3/4", data.previewClassName, { "animate-rotate-small": focused && !isPointer })} src={data.preview} ></img>
|
||||
) : (
|
||||
typeof data.preview === 'function' ? data.preview({ focused }) : data.preview
|
||||
)}
|
||||
{preview}
|
||||
</div>
|
||||
|
||||
<div className="h-0 flex pr-2 justify-end items-center sm:gap-1 md:gap-2 z-2">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue