Files
twenty/front/src/modules/ui/utilities/animation/components/AnimatedEaseIn.tsx
gitstart-twenty ba86be2c5b Remove the {...props} pattern and props coupling, and create an eslint rule for that (#1733)
* Remove the {...props} pattern and props coupling, and create an eslint rule for that

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>

* Add another test to the new rule

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>

---------

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
2023-09-26 11:05:33 +02:00

31 lines
619 B
TypeScript

import { motion } from 'framer-motion';
type Props = Omit<
React.ComponentProps<typeof motion.div>,
'initial' | 'animated' | 'transition'
> & {
duration?: number;
};
export const AnimatedEaseIn = ({
children,
duration = 0.3,
...restProps
}: Props) => {
const initial = { opacity: 0 };
const animate = { opacity: 1 };
const transition = { ease: 'linear', duration };
return (
<motion.div
initial={initial}
animate={animate}
transition={transition}
// eslint-disable-next-line twenty/no-spread-props
{...restProps}
>
{children}
</motion.div>
);
};