bigbuffet-rw/app/soapbox/features/ui/util/optional-motion.tsx

17 lines
404 B
TypeScript
Raw Normal View History

import React from 'react';
import { Motion, MotionProps } from 'react-motion';
import { useSettings } from 'soapbox/hooks';
2022-11-16 05:32:32 -08:00
import ReducedMotion from './reduced-motion';
const OptionalMotion = (props: MotionProps) => {
const reduceMotion = useSettings().get('reduceMotion');
return (
reduceMotion ? <ReducedMotion {...props} /> : <Motion {...props} />
);
};
export default OptionalMotion;