@tra-tech/react-native-kitra
Version:
UI kit for React Native
22 lines • 1.14 kB
JavaScript
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
/* eslint-disable camelcase */
import { Switch as RNSwitch } from 'react-native';
import { applyDefaults } from '../../core/KitraProvider';
const Switch = _ref => {
let {
theme,
...props
} = _ref;
return /*#__PURE__*/React.createElement(RNSwitch, _extends({
trackColor: {
false: theme === null || theme === void 0 ? void 0 : theme.disabledLight,
true: theme === null || theme === void 0 ? void 0 : theme.focused
},
ios_backgroundColor: theme === null || theme === void 0 ? void 0 : theme.white,
thumbColor: props.value ? theme === null || theme === void 0 ? void 0 : theme.white : theme === null || theme === void 0 ? void 0 : theme.white
}, props, {
value: props.value
}));
};
export default applyDefaults(Switch);
//# sourceMappingURL=Switch.js.map