Skip to content
This repository has been archived by the owner on Feb 13, 2025. It is now read-only.

Commit

Permalink
item lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jawndiego committed Feb 25, 2024
1 parent 3d04567 commit 5c2ea68
Showing 1 changed file with 31 additions and 24 deletions.
55 changes: 31 additions & 24 deletions apps/site/components/server/ItemCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { IMAGE_THUMBNAIL_TYPES_TO_RENDER, VIDEO_THUMBNAIL_TYPES_TO_RENDER } from '@/constants'
import {
IMAGE_THUMBNAIL_TYPES_TO_RENDER,
VIDEO_THUMBNAIL_TYPES_TO_RENDER,
} from '@/constants'
import { Flex, Stack, Typography } from '@/design-system'
import { type Adds } from '@/gql'
import { type MediaAssetObject, w3sUrlFromCid } from '@/lib'
Expand Down Expand Up @@ -34,29 +37,33 @@ export async function ItemCard({
className="transition-all"
>
<Stack className="relative aspect-[5/6] justify-center items-center">
{IMAGE_THUMBNAIL_TYPES_TO_RENDER.includes(itemMetadata?.contentType as string) ? (
<Image
className="object-contain"
src={w3sUrlFromCid({ cid: itemMetadata?.image as string })}
alt={itemMetadata?.name as string}
fill
quality={100}
sizes="(min-width: 1200px) 20vw, (min-width: 768px) 25vw, 50vw"
priority={true}
/>
) : VIDEO_THUMBNAIL_TYPES_TO_RENDER.includes(itemMetadata?.contentType as string) ? (
<Image
className="object-contain"
src={`https://image.mux.com/${itemMetadata?.muxPlaybackId}/thumbnail.png?width=1200&height=1000&fit_mode=smartcrop&time=35`}
alt={itemMetadata?.name as string}
fill
quality={100}
sizes="(min-width: 1200px) 20vw, (min-width: 768px) 25vw, 50vw"
priority={true}
/>
) : (
<GenericThumbnailLarge text={itemMetadata?.contentType as string} />
)}
{IMAGE_THUMBNAIL_TYPES_TO_RENDER.includes(
itemMetadata?.contentType as string,
) ? (
<Image
className="object-contain"
src={w3sUrlFromCid({ cid: itemMetadata?.image as string })}
alt={itemMetadata?.name as string}
fill
quality={100}
sizes="(min-width: 1200px) 20vw, (min-width: 768px) 25vw, 50vw"
priority={true}
/>
) : VIDEO_THUMBNAIL_TYPES_TO_RENDER.includes(
itemMetadata?.contentType as string,
) ? (
<Image
className="object-contain"
src={`https://image.mux.com/${itemMetadata?.muxPlaybackId}/thumbnail.png?width=1200&height=1000&fit_mode=smartcrop&time=35`}
alt={itemMetadata?.name as string}
fill
quality={100}
sizes="(min-width: 1200px) 20vw, (min-width: 768px) 25vw, 50vw"
priority={true}
/>
) : (
<GenericThumbnailLarge text={itemMetadata?.contentType as string} />
)}
</Stack>
</Link>
<Stack className="gap-y-[10px]">
Expand Down

0 comments on commit 5c2ea68

Please sign in to comment.