Skip to content

Commit

Permalink
chore: set default value for fadeInDuration in arg
Browse files Browse the repository at this point in the history
  • Loading branch information
dbismut committed Jan 2, 2022
1 parent cd37d28 commit 2c3c92e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const imageShowStrategy = ({ lazyLoad, loaded }: State) => {

export const Image: React.FC<ImagePropTypes> = function ({
className,
fadeInDuration,
fadeInDuration = 500,
intersectionTreshold,
intersectionThreshold,
intersectionMargin,
Expand Down Expand Up @@ -150,8 +150,8 @@ export const Image: React.FC<ImagePropTypes> = function ({
);

const transition =
typeof fadeInDuration === "undefined" || fadeInDuration > 0
? `opacity ${fadeInDuration || 500}ms ${fadeInDuration || 500}ms`
fadeInDuration > 0
? `opacity ${fadeInDuration}ms ${fadeInDuration}ms`
: undefined;

const placeholder = (
Expand Down

0 comments on commit 2c3c92e

Please sign in to comment.