refactor: moved queries to their own file

This commit is contained in:
Simeon Radivoev 2026-03-17 12:57:11 +02:00
parent 364bc9d0be
commit cf6fff6fac
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
83 changed files with 1107 additions and 852 deletions

View file

@ -24,6 +24,8 @@ export function CardList (data: {
onSelectGame?: (id: string) => void;
onGameFocus?: GameCardFocusHandler;
className?: string;
finalElement?: JSX.Element;
saveChildFocus?: 'session' | 'local';
})
{
const { ref, focusKey } = useFocusable({
@ -72,7 +74,7 @@ export function CardList (data: {
title="Games"
id={`card-list-${data.id}`}
ref={ref}
save-child-focus="session"
save-child-focus={data.saveChildFocus}
className={twMerge("items-center justify-center-safe h-full",
data.grid ? "grid h-fit sm:gap-2 md:gap-5 auto-rows-min grid-cols-[repeat(auto-fill,var(--game-card-width))]" :
'landscape:grid landscape:grid-flow-col landscape:auto-cols-min auto-rows-[1fr] sm:gap-2 md:gap-4 portrait:grid portrait:auto-rows-min portrait:grid-cols-[repeat(auto-fill,var(--game-card-width))] *:portrait:aspect-8/10 *:landscape:aspect-8/12 sm:landscape:max-h-84 md:max-h-128!',
@ -83,10 +85,10 @@ export function CardList (data: {
e.preventDefault();
e.stopPropagation();
}}
style={{ scrollbarWidth: "none" }}
>
<FocusContext.Provider value={focusKey}>
{data.games.map(BuildCard)}
{data.finalElement}
</FocusContext.Provider>
</ul>
);