Skip to content

Commit

Permalink
refactor(clerk-js): Extract inAnimation ternary into variable
Browse files Browse the repository at this point in the history
  • Loading branch information
desiprisg committed Oct 23, 2023
1 parent 83ee314 commit 1ae3414
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/clerk-js/src/ui/elements/FormControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,13 @@ function useFormTextAnimation() {
animation: 'none',
};
}

const inAnimation = options?.inDelay ? animations.inDelayAnimation : animations.inAnimation;

return t => ({
animation: `${
enterAnimation
? options?.inDelay
? animations.inDelayAnimation
: animations.inAnimation
: animations.outAnimation
} ${t.transitionDuration.$textField} ${t.transitionTiming.$common}`,
animation: `${enterAnimation ? inAnimation : animations.outAnimation} ${t.transitionDuration.$textField} ${
t.transitionTiming.$common
}`,
transition: `height ${t.transitionDuration.$slow} ${t.transitionTiming.$common}`, // This is expensive but required for a smooth layout shift
});
},
Expand Down

0 comments on commit 1ae3414

Please sign in to comment.