forked from crowetic/commerce
Img Sizes
This commit is contained in:
parent
3b5ac2df1f
commit
c419c3f361
@ -14,6 +14,7 @@ interface Props {
|
|||||||
imgWidth: number | string
|
imgWidth: number | string
|
||||||
imgHeight: number | string
|
imgHeight: number | string
|
||||||
priority?: boolean
|
priority?: boolean
|
||||||
|
imgLayout?: 'fixed' | 'intrinsic' | 'responsive' | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const ProductCard: FC<Props> = ({
|
const ProductCard: FC<Props> = ({
|
||||||
@ -22,6 +23,7 @@ const ProductCard: FC<Props> = ({
|
|||||||
variant,
|
variant,
|
||||||
imgWidth,
|
imgWidth,
|
||||||
imgHeight,
|
imgHeight,
|
||||||
|
imgLayout = 'responsive',
|
||||||
priority,
|
priority,
|
||||||
}) => {
|
}) => {
|
||||||
const src = p.images.edges?.[0]?.node?.urlOriginal!
|
const src = p.images.edges?.[0]?.node?.urlOriginal!
|
||||||
@ -50,6 +52,7 @@ const ProductCard: FC<Props> = ({
|
|||||||
height={imgHeight}
|
height={imgHeight}
|
||||||
priority={priority}
|
priority={priority}
|
||||||
quality="85"
|
quality="85"
|
||||||
|
layout={imgLayout}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
@apply flex-1 px-16 py-4;
|
@apply flex-1 px-16 py-4;
|
||||||
width: 450px;
|
width: 430px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
images: {
|
images: {
|
||||||
sizes: [320, 480, 820, 1200, 1600],
|
imagesSizes: [320, 480, 820, 1200, 1600],
|
||||||
domains: ['cdn11.bigcommerce.com'],
|
domains: ['cdn11.bigcommerce.com'],
|
||||||
},
|
},
|
||||||
i18n: {
|
i18n: {
|
||||||
|
@ -97,6 +97,7 @@ export default function Home({
|
|||||||
variant="slim"
|
variant="slim"
|
||||||
imgWidth={320}
|
imgWidth={320}
|
||||||
imgHeight={320}
|
imgHeight={320}
|
||||||
|
imgLayout="fixed"
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Marquee>
|
</Marquee>
|
||||||
@ -129,6 +130,7 @@ export default function Home({
|
|||||||
variant="slim"
|
variant="slim"
|
||||||
imgWidth={320}
|
imgWidth={320}
|
||||||
imgHeight={320}
|
imgHeight={320}
|
||||||
|
imgLayout="fixed"
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Marquee>
|
</Marquee>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user