UNPKG

@botonic/react

Version:

Build Chatbots using React

17 lines 1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConditionalAnimation = void 0; const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = tslib_1.__importStar(require("react")); const constants_1 = require("../../constants"); const styles_1 = require("../../shared/styles"); const react_2 = require("../../util/react"); const context_1 = require("../context"); const ConditionalAnimation = props => { const { getThemeProperty } = (0, react_1.useContext)(context_1.WebchatContext); const animationsEnabled = getThemeProperty(constants_1.WEBCHAT.CUSTOM_PROPERTIES.enableAnimations); return ((0, jsx_runtime_1.jsx)(react_2.ConditionalWrapper, Object.assign({ condition: animationsEnabled, wrapper: children => (0, jsx_runtime_1.jsx)(styles_1.Scale, { children: children }) }, { children: props.children }))); }; exports.ConditionalAnimation = ConditionalAnimation; //# sourceMappingURL=conditional-animation.js.map