From 2cf9abd329f4dff922a234dfe00daa84f8e71344 Mon Sep 17 00:00:00 2001 From: Fabrizio Monti Date: Wed, 25 Mar 2020 01:12:23 +0100 Subject: [PATCH] Refactoring fadein transition condition --- src/Image/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Image/index.js b/src/Image/index.js index 6beea31..27588b9 100644 --- a/src/Image/index.js +++ b/src/Image/index.js @@ -129,7 +129,7 @@ export const Image = { backgroundSize: "cover", opacity: showImage ? 0 : 1, transition: - !fadeInDuration || fadeInDuration > 0 + fadeInDuration ? `opacity ${fadeInDuration}ms ${fadeInDuration}ms` : null, ...absolutePositioning, @@ -171,10 +171,7 @@ export const Image = { style={{ ...absolutePositioning, opacity: showImage ? 1 : 0, - transition: - !fadeInDuration || fadeInDuration > 0 - ? `opacity ${fadeInDuration}ms` - : null, + transition: fadeInDuration ? `opacity ${fadeInDuration}ms` : null, }} > {webpSource}