UNPKG

@botonic/react

Version:

Build Chatbots using React

12 lines 831 B
import { jsx as _jsx } from "react/jsx-runtime"; import { motion } from 'framer-motion'; import React, { useContext } from 'react'; import { WEBCHAT } from '../../constants'; import { WebchatContext } from '../../contexts'; import { ConditionalWrapper } from '../../util/react'; export const ConditionalAnimation = props => { const { getThemeProperty } = useContext(WebchatContext); const animationsEnabled = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.enableAnimations, props.enableAnimations !== undefined ? props.enableAnimations : true); return (_jsx(ConditionalWrapper, Object.assign({ condition: animationsEnabled, wrapper: children => (_jsx(motion.div, Object.assign({ whileHover: { scale: 1.2 } }, { children: children }))) }, { children: props.children }))); }; //# sourceMappingURL=conditional-animation.js.map