* ESLint rule: const naming Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev> * Refactor according to review Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev> * refactor: Reverts changes on `twenty-server` Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev> Co-authored-by: v1b3m <vibenjamin6@gmail.com> --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev>
31 lines
734 B
TypeScript
31 lines
734 B
TypeScript
import { useTheme } from '@emotion/react';
|
|
import { motion } from 'framer-motion';
|
|
|
|
import { AnimationDuration } from '@/ui/theme/constants/Animation';
|
|
|
|
type AnimatedEaseInProps = Omit<
|
|
React.ComponentProps<typeof motion.div>,
|
|
'initial' | 'animated' | 'transition'
|
|
> & {
|
|
duration?: AnimationDuration;
|
|
};
|
|
|
|
export const AnimatedEaseIn = ({
|
|
children,
|
|
duration = 'normal',
|
|
}: AnimatedEaseInProps) => {
|
|
const theme = useTheme();
|
|
const initial = { opacity: 0 };
|
|
const animate = { opacity: 1 };
|
|
const transition = {
|
|
ease: 'linear',
|
|
duration: theme.animation.duration[duration],
|
|
};
|
|
|
|
return (
|
|
<motion.div initial={initial} animate={animate} transition={transition}>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
};
|