Files
twenty_crm/packages/twenty-ui/src/utilities/animation/components/AnimatedTranslation.tsx
gitstart-app[bot] 113e9fc8c7 Migrate to twenty-ui - utilities/animation (#7951)
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>
2024-10-22 18:08:54 +02:00

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>
);
};