Skip to content

Commit

Permalink
Fix variant images being very duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
Allypost committed Aug 14, 2023
1 parent 7f98ace commit 10cc3e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/base/aspect-ratio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const AspectRatio: FC<AspectRatioProps> = (props) => {
<div
className="relative w-full"
style={{
...props.style,
paddingBottom: `${100 / ratio}%`,
aspectRatio: ratio,
}}
>
<div
Expand Down
8 changes: 6 additions & 2 deletions src/components/base/image/variant-image/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { type FC } from "react";

import { cn } from "~/utils/class";
import { src as imgSrc, urlVariants } from "~/utils/kset-image";
import {
DefaultUrlVariants,
src as imgSrc,
urlVariant,
} from "~/utils/kset-image";

import AppImage, { type AppImageProps } from "../app-image";

Expand All @@ -27,7 +31,7 @@ const VariantImage: FC<
aspect={{
ratio,
style: {
backgroundImage: urlVariants(src),
backgroundImage: urlVariant(src, DefaultUrlVariants.Thumb),
...aspect?.style,
},
...aspect,
Expand Down

0 comments on commit 10cc3e6

Please sign in to comment.