Skip to content

Commit

Permalink
Refactoring fadein transition condition
Browse files Browse the repository at this point in the history
  • Loading branch information
delphaber committed Mar 25, 2020
1 parent 6a6901a commit 2cf9abd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 2cf9abd

Please sign in to comment.