Skip to content

Commit

Permalink
change images to use webp format
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanKiral committed Nov 22, 2024
1 parent 4f7c227 commit c268b9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/FeaturedComponentBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const FeaturedComponentBase: FC<FeaturedContentProps> = ({ type, image, children
<img
width={640}
height={420}
src={image.value[0]?.url ?? ""}
src={image.value[0]?.url ? `${image.value[0]?.url}?auto=format` : ""}
alt={image.value[0].description ?? "image alt"}
className="object-cover rounded-lg static"
/>
Expand Down
4 changes: 2 additions & 2 deletions src/components/HeroImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ const HeroImage: FC<HeroImageProps> = ({ data }) => {
</RenderElement>
</div>
<div className="xl:basis-1/2">
<RenderElement element={data.heroImage} elementCodename="hero_image" requiredElementType="text">
<RenderElement element={data.heroImage} elementCodename="hero_image" requiredElementType="asset">
{data.heroImage?.value[0]
? (
<img
className=" object-cover mx-auto"
width={670}
height={440}
src={data.heroImage.value[0].url}
src={`${data.heroImage.value[0].url}?auto=format`}
alt={data.heroImage.value[0].description ?? "image-alt"}
>
</img>
Expand Down

0 comments on commit c268b9e

Please sign in to comment.