diff --git a/packages/website/src/components/Gallery/Card.tsx b/packages/website/src/components/Gallery/Card.tsx index 1095d55ea..a2d6ba74f 100644 --- a/packages/website/src/components/Gallery/Card.tsx +++ b/packages/website/src/components/Gallery/Card.tsx @@ -1,4 +1,12 @@ -import { Flex, Skeleton, Text } from '@radix-ui/themes'; +import { Cross1Icon, DownloadIcon } from '@radix-ui/react-icons'; +import { + Dialog, + Flex, + IconButton, + Link, + Skeleton, + Text, +} from '@radix-ui/themes'; import { useRef } from 'react'; import { useIntersection } from '../../hooks/useIntersection'; import type { MaybeSkeletonComponentProps } from '../../types/maybeSkeletonComponentProps'; @@ -9,14 +17,22 @@ type GalleryCardProps = MaybeSkeletonComponentProps<{ }>; export function GalleryCard(props: GalleryCardProps) { + const src = `/api/gallery/${!props.skeleton && props.id}.webp`; const card = useRef(null); useIntersection(() => props.skeleton && props.onIntersection?.(), card, { disabled: !props.skeleton || props.onIntersection === undefined, }); - return ( - + const content = ( + {props.skeleton && ( <> @@ -33,14 +49,52 @@ export function GalleryCard(props: GalleryCardProps) { // aspect ratio 7 / 8 objectFit: 'cover', }} - src={`/api/gallery/${props.id}.webp`} + src={src} + alt={props.name} /> - + {props.name} )} ); + + if (props.skeleton) return content; + + return ( + + {content} + + event.preventDefault()} + width="fit-content" + > + + + + + + + + + + + + + + + + {props.name} + + + + + {props.name} + + + + + ); } diff --git a/packages/website/src/pages/tools/gallery/_index.tsx b/packages/website/src/pages/tools/gallery/_index.tsx index 37a7dc525..8c06e8cfd 100644 --- a/packages/website/src/pages/tools/gallery/_index.tsx +++ b/packages/website/src/pages/tools/gallery/_index.tsx @@ -1,5 +1,6 @@ import { GalleryList, type Avatar } from '../../../components/Gallery/List'; import { GallerySearch } from '../../../components/Gallery/Search'; +import { PageWrapper } from '../../../components/PageWrapper'; import { GalleryEphemeral } from '../../../stores/galleryEphemeral'; interface PageProps { @@ -8,9 +9,11 @@ interface PageProps { export function Page({ avatars }: PageProps) { return ( - - - - + + + + + + ); } diff --git a/packages/website/src/pages/tools/gallery/index.astro b/packages/website/src/pages/tools/gallery/index.astro index f49a17430..085c8e209 100644 --- a/packages/website/src/pages/tools/gallery/index.astro +++ b/packages/website/src/pages/tools/gallery/index.astro @@ -1,6 +1,5 @@ --- import type { Avatar } from '../../../components/Gallery/List'; -import { PageWrapper } from '../../../components/PageWrapper'; import { galleryTool } from '../../../constants/tools'; import { fetchGlossary } from '../../../core/blitz/fetchGlossary'; import ToolLayout from '../../../layouts/ToolLayout.astro'; @@ -22,7 +21,5 @@ const avatars = Object.entries(glossary) --- - - - +