UNPKG

omnipay-savings-sdk

Version:

Omnipay Savings SDK

48 lines (47 loc) 4.47 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 utils_1 = require("../../utils"); const Button_1 = require("../Button"); const Text_1 = require("../Text"); const SmartImage_1 = require("../Images/SmartImage"); const Dropdown = (props) => { const { containerStyle, label, style, placeHolder = 'Select from dropdown', value, onPress, loading, errorMsg = '', subScriptLeft = '', subScriptRight = '', showAsterisk, } = props; return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(react_native_1.View, Object.assign({ style: [containerStyle] }, { children: [typeof label === 'string' ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, Object.assign({ style: { flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', } }, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { fontSize: (0, utils_1.fontSz)(14), fontFamily: "Gordita-Regular", fontWeight: "400", text: `${label}`, color: utils_1.Colors.inputBackgroundLight }), showAsterisk && ((0, jsx_runtime_1.jsx)(Text_1.Text, { fontSize: (0, utils_1.fontSz)(14), fontFamily: "Gordita-Regular", fontWeight: "400", text: '*', color: utils_1.Colors.debitRed }))] }))) : (label), (0, jsx_runtime_1.jsxs)(Button_1.CustomPressable, Object.assign({ activeOpacity: 0.75, onPress: onPress, style: { flexDirection: 'row', height: (0, utils_1.hp)(55), paddingHorizontal: (0, utils_1.fontSz)(14), marginTop: (0, utils_1.fontSz)(8), borderRadius: (0, utils_1.fontSz)(8), borderWidth: (0, utils_1.fontSz)(1), backgroundColor: '#F4F4F4', alignItems: 'center', borderColor: errorMsg.length > 0 ? utils_1.Colors.error : '#F4F4F4', } }, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { style: [ { flex: 1, fontFamily: 'Gordita-Medium', color: value.length > 0 ? utils_1.Colors.baseBlueText : '#C4C4C4', }, style, ], fontSize: (0, utils_1.fontSz)(15), text: `${(value === null || value === void 0 ? void 0 : value.length) > 0 ? value : placeHolder}` }), (0, jsx_runtime_1.jsx)(react_native_1.View, Object.assign({ style: { justifyContent: 'center', } }, { children: (0, jsx_runtime_1.jsxs)(Button_1.CustomPressable, Object.assign({ activeOpacity: 0.75, onPress: onPress }, { children: [loading && ((0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: 'small', color: utils_1.Colors.tabText })), !loading && ((0, jsx_runtime_1.jsx)(SmartImage_1.SmartImage, { source: utils_1.Images.dropdown, style: { width: (0, utils_1.ms)(18), height: (0, utils_1.ms)(18), tintColor: utils_1.Colors.tabText, } }))] })) }))] })), (0, jsx_runtime_1.jsx)(react_native_1.View, Object.assign({ style: [ { position: 'absolute', bottom: (0, utils_1.ms)(-20), width: '100%', }, ] }, { children: (0, jsx_runtime_1.jsxs)(react_native_1.View, Object.assign({ style: [utils_1.globalStyles.rowBetween, { width: '100%' }] }, { children: [subScriptLeft.length > 0 && ((0, jsx_runtime_1.jsx)(Text_1.Text, { fontSize: (0, utils_1.fontSz)(13), fontFamily: "Gordita-Regular", fontWeight: "400", text: `${subScriptLeft}`, color: utils_1.Colors.inputBackground, textAlign: 'right' })), subScriptRight.length > 0 && ((0, jsx_runtime_1.jsx)(Text_1.Text, { fontSize: (0, utils_1.fontSz)(13), fontFamily: "Gordita-Regular", fontWeight: "400", text: `${subScriptRight}`, color: utils_1.Colors.inputBackground, textAlign: 'right' }))] })) }))] })) })); }; exports.default = Dropdown; const styles = react_native_1.StyleSheet.create({});