UNPKG

@madeja-studio/telar

Version:

UI component library by Madeja Studio

2 lines 1.73 kB
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AnimatedSwitch=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _native=require("@react-spring/native");var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _index=_interopRequireDefault(require("../../tailwind/index.js"));var _useAnimatedSwitch2=_interopRequireDefault(require("./useAnimatedSwitch.js"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["children","style","visibleComponent"];var _this=void 0,_jsxFileName="/Users/sergio/Development/madeja.studio/telar/src/component/AnimatedSwitch/AnimatedSwitch.tsx";var AnimatedSwitch=exports.AnimatedSwitch=function AnimatedSwitch(_ref){var children=_ref.children,style=_ref.style,visibleComponent=_ref.visibleComponent,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _useAnimatedSwitch=(0,_useAnimatedSwitch2.default)({visibleComponent:visibleComponent}),aCompStyle=_useAnimatedSwitch.aCompStyle,bCompStyle=_useAnimatedSwitch.bCompStyle;return(0,_jsxRuntime.jsxs)(_reactNative.View,Object.assign({style:[(0,_index.default)`flex flex-shrink`,style]},props,{children:[(0,_jsxRuntime.jsx)(_native.animated.View,{pointerEvents:visibleComponent===0?'auto':'none',style:[(0,_index.default)`relative fill center`,aCompStyle],children:children[0]}),(0,_jsxRuntime.jsx)(_native.animated.View,{pointerEvents:visibleComponent===1?'auto':'none',style:[(0,_index.default)`absolute fill center`,bCompStyle],children:children[1]})]}));}; //# sourceMappingURL=AnimatedSwitch.js.map