bigbuffet-rw/app/soapbox/features/ui/util/optional-motion.tsx
2022-11-16 08:35:35 -05:00

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;