Skip to content

Commit

Permalink
Img Sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
okbel committed Nov 5, 2020
1 parent 3b5ac2d commit c419c3f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions components/product/ProductCard/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface Props {
imgWidth: number | string
imgHeight: number | string
priority?: boolean
imgLayout?: 'fixed' | 'intrinsic' | 'responsive' | undefined
}

const ProductCard: FC<Props> = ({
Expand All @@ -22,6 +23,7 @@ const ProductCard: FC<Props> = ({
variant,
imgWidth,
imgHeight,
imgLayout = 'responsive',
priority,
}) => {
const src = p.images.edges?.[0]?.node?.urlOriginal!
Expand Down Expand Up @@ -50,6 +52,7 @@ const ProductCard: FC<Props> = ({
height={imgHeight}
priority={priority}
quality="85"
layout={imgLayout}
/>
</div>
) : (
Expand Down
2 changes: 1 addition & 1 deletion components/ui/Marquee/Marquee.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

& > * {
@apply flex-1 px-16 py-4;
width: 450px;
width: 430px;
}
}

Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
images: {
sizes: [320, 480, 820, 1200, 1600],
imagesSizes: [320, 480, 820, 1200, 1600],
domains: ['cdn11.bigcommerce.com'],
},
i18n: {
Expand Down
2 changes: 2 additions & 0 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export default function Home({
variant="slim"
imgWidth={320}
imgHeight={320}
imgLayout="fixed"
/>
))}
</Marquee>
Expand Down Expand Up @@ -129,6 +130,7 @@ export default function Home({
variant="slim"
imgWidth={320}
imgHeight={320}
imgLayout="fixed"
/>
))}
</Marquee>
Expand Down

0 comments on commit c419c3f

Please sign in to comment.