From 1ae3414229764eebc12575e046ffa4a3b7777bfa Mon Sep 17 00:00:00 2001 From: George Desipris Date: Fri, 20 Oct 2023 02:49:26 +0300 Subject: [PATCH] refactor(clerk-js): Extract inAnimation ternary into variable --- packages/clerk-js/src/ui/elements/FormControl.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/clerk-js/src/ui/elements/FormControl.tsx b/packages/clerk-js/src/ui/elements/FormControl.tsx index 46b47435ee..945588574e 100644 --- a/packages/clerk-js/src/ui/elements/FormControl.tsx +++ b/packages/clerk-js/src/ui/elements/FormControl.tsx @@ -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 }); },