Closed angeloashmore closed 2 years ago
Path | Size |
---|---|
./dist/index.mjs | 4.22 KB (+3.11% πΊ) |
Merging #42 (b39e405) into main (dd2f06b) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## main #42 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 11 11
Lines 672 713 +41
Branches 33 43 +10
=========================================
+ Hits 672 713 +41
Impacted Files | Coverage Ξ | |
---|---|---|
src/PrismicNextImage.tsx | 100.00% <100.00%> (ΓΈ) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
It will be nice to handle the https://nextjs.org/docs/api-reference/next/future/image as well because the current image component has its days numbered now.
Hey @webda2l, yes, next/future/image
support is planned, but it's not clear yet how it could be done.
We may need to wait until next/future/image
becomes the default next/image
. If you have any suggestions, I'm more than happy to listen! π
Types of changes
Description
This PR adds support for
width
andheight
props in<PrismicNextImage>
when thelayout
prop isintrinsic
orfixed
.When using the
intrinsic
orfixed
layout, thewidth
andheight
props define the size of the rendered image. If nowidth
orheight
are given, the image's source dimensions are used.When using
responsive
orfill
, thewidth
andheight
props define the source image's dimensions. The provided Image field already contains this information, thus thewidth
andheight
props are not allowed in this situation.Examples
Default layout (intrinsic)
layout="intrinsic"
layout="fixed"
layout="responsive"
layout="fill"
Checklist:
π»