Skip to content

Commit

Permalink
fix: add aspect ratio on images
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriassuncx committed Oct 22, 2024
1 parent a9786ea commit 10cf043
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/product/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ interface Props {
platform?: Platform;
}

const WIDTH = 292;
const HEIGHT = 220;
const WIDTH = 200;
const HEIGHT = 133;

function ProductCard({
product,
Expand Down Expand Up @@ -112,7 +112,8 @@ function ProductCard({
alt={front.alternateName}
width={WIDTH}
height={HEIGHT}
class="col-span-full row-span-full rounded w-full h-3/4 object-contain"
style={{ aspectRatio: `${WIDTH} / ${HEIGHT}` }}
class="col-span-full row-span-full rounded w-full object-contain"
sizes="(max-width: 640px) 50vw, 20vw"
loading="lazy"
decoding="async"
Expand Down
1 change: 1 addition & 0 deletions components/ui/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export type AvailableIcons =
| "Curativo"
| "Seringa"
| "Coração"
| "MonitorPressao"
| "Share"
| "Youtube"
| "BenefitsGuard"
Expand Down
34 changes: 34 additions & 0 deletions static/sprites.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 10cf043

Please sign in to comment.