bigbuffet-rw/app/soapbox/features/ui/util/optional_motion.tsx

16 lines
404 B
TypeScript

import React from 'react';
import { Motion, MotionProps } from 'react-motion';
import { useSettings } from 'soapbox/hooks';
import ReducedMotion from './reduced_motion';
const OptionalMotion = (props: MotionProps) => {
const reduceMotion = useSettings().get('reduceMotion');
return (
reduceMotion ? <ReducedMotion {...props} /> : <Motion {...props} />
);
};
export default OptionalMotion;