UNPKG

omnipay-savings-sdk

Version:

Omnipay Savings SDK

36 lines (35 loc) 1.86 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const react_native_1 = require("react-native"); const Button_1 = require("../Button"); const utils_1 = require("../../utils"); const Text_1 = require("../Text"); const CheckBox = ({ label, selected = true, onPress, containerStyle, }) => { return ((0, jsx_runtime_1.jsx)(Button_1.CustomPressable, Object.assign({ onPress: onPress, activeOpacity: 0.8 }, { children: (0, jsx_runtime_1.jsxs)(react_native_1.View, Object.assign({ style: [styles.radioButton, containerStyle] }, { children: [(0, jsx_runtime_1.jsx)(react_native_1.View, Object.assign({ style: [styles.radioButtonInner] }, { children: selected && (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles.radioButtonSelected] }) })), typeof label === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { fontSize: (0, utils_1.fontSz)(12), fontFamily: "Gordita-Medium", fontWeight: "400", text: `${label}`, color: utils_1.Colors.inputBackground })) : (label)] })) }))); }; exports.default = CheckBox; const styles = react_native_1.StyleSheet.create({ radioButton: { flexDirection: 'row', alignItems: 'center', marginVertical: (0, utils_1.ms)(5), }, radioButtonInner: { width: (0, utils_1.ms)(20), height: (0, utils_1.ms)(20), borderRadius: (0, utils_1.ms)(4), borderWidth: (0, utils_1.ms)(1.5), borderColor: utils_1.Colors.gray500, marginRight: (0, utils_1.ms)(10), justifyContent: 'center', alignItems: 'center', backgroundColor: utils_1.Colors.white, }, radioButtonSelected: { width: (0, utils_1.ms)(12), height: (0, utils_1.ms)(12), borderRadius: (0, utils_1.ms)(2), backgroundColor: utils_1.Colors.purple60, }, });