mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
glossary
This commit is contained in:
1 parent
851a1108d2
commit
bc2b9f1267
10 files changed
+174
-15
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { asset, Avatar } from "@blitzkit/core";
|
||||
import { Avatar } from "@blitzkit/core";
|
||||
import { Cross1Icon, DownloadIcon } from "@radix-ui/react-icons";
|
||||
import {
|
||||
Dialog,
|
||||
@@ -18,9 +18,7 @@ type GalleryCardProps = MaybeSkeletonComponentProps<{
|
||||
}>;
|
||||
|
||||
export function GalleryCard(props: GalleryCardProps) {
|
||||
const src = asset(
|
||||
`gallery/avatars/${!props.skeleton && `${props.avatar.id}${props.avatar.extension}`}`,
|
||||
);
|
||||
const src = `/api/gallery/avatars/${!props.skeleton && `${props.avatar.id}${props.avatar.extension}`}`;
|
||||
const card = useRef<HTMLDivElement>(null!);
|
||||
const { unwrap } = useLocale();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Flex, Text } from "@radix-ui/themes";
|
||||
import fuzzysort from "fuzzysort";
|
||||
import { times } from "lodash-es";
|
||||
import { useMemo, useState } from "react";
|
||||
import { awaitableGallery } from "../../core/awaitables/gallery";
|
||||
import { api } from "../../core/blitzkit/api";
|
||||
import { useLocale } from "../../hooks/useLocale";
|
||||
import { Gallery } from "../../stores/gallery";
|
||||
import type { MaybeSkeletonComponentProps } from "../../types/maybeSkeletonComponentProps";
|
||||
@@ -16,7 +16,7 @@ export interface Avatar {
|
||||
id: string;
|
||||
}
|
||||
|
||||
const gallery = await awaitableGallery;
|
||||
const gallery = await api.galleryDefinitions();
|
||||
|
||||
const DEFAULT_LOADED = 42;
|
||||
const PREVIEW_COUNT = 28;
|
||||
@@ -35,7 +35,7 @@ export function GalleryList({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
.go(search, gallery.avatars, {
|
||||
keys: [
|
||||
...locales.supported.map(
|
||||
(supported) => `name.locales.${supported.locale}`
|
||||
(supported) => `name.locales.${supported.locale}`,
|
||||
),
|
||||
"id",
|
||||
],
|
||||
@@ -72,7 +72,7 @@ export function GalleryList({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
skeleton
|
||||
onIntersection={() => setLoadedCards((state) => state + 2)}
|
||||
/>
|
||||
)
|
||||
),
|
||||
)}
|
||||
</Flex>
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user