2024-01-07 03:29:16 +03:00
|
|
|
import { motion } from 'framer-motion';
|
|
|
|
|
|
|
|
import { animateFade } from '@/styling/animations';
|
|
|
|
|
2024-03-20 15:27:32 +03:00
|
|
|
import { CProps } from '../props';
|
2024-01-07 03:29:16 +03:00
|
|
|
|
|
|
|
interface AnimateFadeProps extends CProps.AnimatedDiv {
|
|
|
|
noFadeIn?: boolean;
|
|
|
|
noFadeOut?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
function AnimateFade({ noFadeIn, noFadeOut, children, ...restProps }: AnimateFadeProps) {
|
|
|
|
return (
|
|
|
|
<motion.div
|
|
|
|
initial={{ ...(!noFadeIn ? animateFade.initial : {}) }}
|
|
|
|
animate={{ ...animateFade.animate }}
|
|
|
|
exit={{ ...(!noFadeOut ? animateFade.exit : {}) }}
|
|
|
|
{...restProps}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</motion.div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AnimateFade;
|