File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -337,7 +337,7 @@ You will need to add it in your graphql query as is shown in the following snipp
337337| ---------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------- |
338338| ` fixed ` | ` object ` | Data returned from the ` fixed ` query |
339339| ` fluid ` | ` object ` | Data returned from the ` fluid ` query |
340- | ` fadeIn ` | ` bool ` | Defaults to fading in the image on load |
340+ | ` fadeIn ` | ` number ` | Defaults to fading in the image on load in 500ms |
341341| ` title ` | ` string ` | Passed to the ` img ` element |
342342| ` alt ` | ` string ` | Passed to the ` img ` element |
343343| ` crossOrigin ` | ` string ` | Passed to the ` img ` element |
Original file line number Diff line number Diff line change @@ -260,9 +260,13 @@ class Image extends React.Component {
260260 itemProp,
261261 } = convertProps ( this . props )
262262
263- const shouldReveal = this . state . imgLoaded || this . state . fadeIn === false
264- const shouldFadeIn = this . state . fadeIn === true && ! this . state . imgCached
265- const durationFadeIn = `0.5s`
263+ const shouldReveal =
264+ this . state . imgLoaded || Boolean ( this . state . fadeIn ) === false
265+ const shouldFadeIn =
266+ Boolean ( this . state . fadeIn ) === true && ! this . state . imgCached
267+ const durationFadeIn = Number . isInteger ( this . state . fadeIn )
268+ ? `${ this . state . fadeIn } ms`
269+ : `0.5s`
266270
267271 const imageStyle = {
268272 opacity : shouldReveal ? 1 : 0 ,
You can’t perform that action at this time.
0 commit comments