UNPKG

@fruits-chain/react-native-xiaoshu

Version:
62 lines (54 loc) 1.82 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getBorderRadius = exports.createStyles = exports.PopupPositionMap = void 0; var _reactNative = require("react-native"); var _omit = _interopRequireDefault(require("lodash/omit")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const createStyles = themeVar => { return _reactNative.StyleSheet.create({ popup: { position: 'relative', backgroundColor: themeVar.popup_background_color, overflow: 'hidden', height: 0 }, popup_active: { position: 'absolute', height: 'auto' } }); }; exports.createStyles = createStyles; const getBorderRadius = (themeVar, position, round) => { const borderRadius = round ? themeVar.popup_round_border_radius : 0; return { borderTopLeftRadius: position === 'bottom' || position === 'right' ? borderRadius : 0, borderTopRightRadius: position === 'bottom' || position === 'left' ? borderRadius : 0, borderBottomLeftRadius: position === 'top' || position === 'right' ? borderRadius : 0, borderBottomRightRadius: position === 'top' || position === 'left' ? borderRadius : 0 }; }; exports.getBorderRadius = getBorderRadius; const absolute = { left: 0, top: 0, bottom: 0, right: 0 }; const PopupPositionMap = { center: { flex: 1, backgroundColor: 'transparent', // backgroundColor: 'rgba(0,0,0,0.8)', // to test ui alignItems: 'center', justifyContent: 'center' }, left: (0, _omit.default)(absolute, ['right']), right: (0, _omit.default)(absolute, ['left']), top: (0, _omit.default)(absolute, ['bottom']), bottom: (0, _omit.default)(absolute, ['top']) }; exports.PopupPositionMap = PopupPositionMap; //# sourceMappingURL=style.js.map