2022-03-26 15:26:26 -07:00
|
|
|
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';
|
2022-03-26 15:26:26 -07:00
|
|
|
|
|
|
|
const OptionalMotion = (props: MotionProps) => {
|
|
|
|
const reduceMotion = useSettings().get('reduceMotion');
|
|
|
|
|
|
|
|
return (
|
|
|
|
reduceMotion ? <ReducedMotion {...props} /> : <Motion {...props} />
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default OptionalMotion;
|