respond-framework
Version:
create as fast you think
69 lines (68 loc) • 1.62 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = require("react");
var _reactNative = require("react-native");
var _RadioButton = require("./RadioButton.js");
var _styles = require("../styles.js");
var _default = exports.default = /*#__PURE__*/React.memo(({
event,
name,
label,
value,
options,
style,
styleLabel,
styleRadios,
styleRadio,
styleRadioActive,
styleRadioText,
styleRadioTextActive,
styleLeft,
styleRight,
zIndex = style?.zIndex ?? 1
}) => /*#__PURE__*/React.createElement(_reactNative.View, {
style: [s.c, style]
}, label && /*#__PURE__*/React.createElement(_reactNative.Text, {
style: [s.label, styleLabel]
}, label, ":"), /*#__PURE__*/React.createElement(_reactNative.View, {
style: [s.radios, styleRadios]
}, options.map((o, last) => /*#__PURE__*/React.createElement(_RadioButton.default, {
...o,
event,
name,
key: o.value,
active: o.value === value,
style: [styleRadio, {
zIndex
}, last ? [right, styleRight] : [left, styleLeft]],
styleActive: styleRadioActive,
styleText: styleRadioText,
styleTextActive: styleRadioTextActive
})))));
const left = {
borderTopLeftRadius: 5,
borderBottomLeftRadius: 5
};
const right = {
borderTopRightRadius: 5,
borderBottomRightRadius: 5
};
const s = _reactNative.StyleSheet.create({
c: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
marginTop: 9,
zIndex: 1
},
label: {
fontSize: 15,
color: _styles.colors.whiteDark
},
radios: {
flexDirection: 'row'
}
});