This PR was created by [GitStart](https://gitstart.com/) to address the requirements from this ticket: [TWNTY-7538](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7538). --- ### Description - Move animation components to `twenty-ui` \ \ \ Fixes #7538 Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Charles Bochet <charles@twenty.com>
34 lines
714 B
TypeScript
34 lines
714 B
TypeScript
import { useTheme } from '@emotion/react';
|
|
import { motion } from 'framer-motion';
|
|
|
|
type AnimatedTranslationProps = {
|
|
children: React.ReactNode;
|
|
};
|
|
|
|
export const AnimatedTranslation = ({ children }: AnimatedTranslationProps) => {
|
|
const theme = useTheme();
|
|
|
|
return (
|
|
<motion.div
|
|
initial="hidden"
|
|
animate="visible"
|
|
variants={{
|
|
hidden: {
|
|
opacity: 0,
|
|
y: -20,
|
|
},
|
|
visible: {
|
|
opacity: 1,
|
|
y: 0,
|
|
transition: {
|
|
duration: theme.animation.duration.normal, // Replace this with your theme's duration
|
|
ease: 'easeInOut',
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
};
|