@botonic/react
Version:
Build Chatbots using React
17 lines • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConditionalAnimation = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const framer_motion_1 = require("framer-motion");
const react_1 = tslib_1.__importStar(require("react"));
const constants_1 = require("../../constants");
const contexts_1 = require("../../contexts");
const react_2 = require("../../util/react");
const ConditionalAnimation = props => {
const { getThemeProperty } = (0, react_1.useContext)(contexts_1.WebchatContext);
const animationsEnabled = getThemeProperty(constants_1.WEBCHAT.CUSTOM_PROPERTIES.enableAnimations, props.enableAnimations !== undefined ? props.enableAnimations : true);
return ((0, jsx_runtime_1.jsx)(react_2.ConditionalWrapper, Object.assign({ condition: animationsEnabled, wrapper: children => ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, Object.assign({ whileHover: { scale: 1.2 } }, { children: children }))) }, { children: props.children })));
};
exports.ConditionalAnimation = ConditionalAnimation;
//# sourceMappingURL=conditional-animation.js.map