UNPKG

omnipay-savings-sdk

Version:

Omnipay Savings SDK

36 lines (35 loc) 3.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const react_native_1 = require("react-native"); const utils_1 = require("../../utils"); const Text_1 = require("../Text"); const AccountNumberInput = (props, ref) => { const { value, containerStyle, label, placeholder, inputStyle, prependComponent, appendComponent, onChange, onEndEditing, onFocus, secureTextEntry, keyboardType = 'numeric', autoCompleteType = 'off', autoCapitalize = 'none', errorMsg = '', multiline = false, numberOfLines = 1, maxLength, isLoading = false, returnKeyLabel, returnKeyType, editable = true, // topComponent, beneficiary, } = props; return ((0, jsx_runtime_1.jsxs)(react_native_1.View, Object.assign({ style: Object.assign({ position: 'relative', paddingBottom: (0, utils_1.ms)(8) }, containerStyle) }, { children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, Object.assign({ style: utils_1.globalStyles.rowBetween }, { children: [typeof label === 'string' ? ((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 })) : (label), topComponent !== null && topComponent !== void 0 ? topComponent : topComponent] })), (0, jsx_runtime_1.jsxs)(react_native_1.View, Object.assign({ style: { flexDirection: 'row', height: (0, utils_1.hp)(55), paddingHorizontal: (0, utils_1.ms)(10), marginTop: (0, utils_1.ms)(4), borderRadius: (0, utils_1.ms)(8), borderColor: errorMsg.length > 0 ? utils_1.Colors.error : '#F4F4F4', borderWidth: (0, utils_1.ms)(1), backgroundColor: '#F4F4F4', } }, { children: [prependComponent, (0, jsx_runtime_1.jsx)(react_native_1.TextInput, { style: Object.assign(Object.assign({ flex: 1 }, inputStyle), { color: utils_1.Colors.baseBlueText, fontFamily: 'Gordita-Medium', opacity: editable ? 1 : 0.5 }), placeholder: placeholder, value: value, placeholderTextColor: '#C4C4C4', onChangeText: text => onChange(text), onEndEditing: text => onEndEditing(text), onFocus: text => onFocus(), secureTextEntry: secureTextEntry, keyboardType: keyboardType, autoComplete: autoCompleteType, autoCapitalize: autoCapitalize, multiline: multiline, numberOfLines: numberOfLines, returnKeyLabel: returnKeyLabel, returnKeyType: returnKeyType, editable: editable, maxLength: maxLength }), appendComponent] })), errorMsg.length > 0 && ((0, jsx_runtime_1.jsx)(Text_1.Text, { style: { // paddingTop: ms(2.5), position: 'absolute', bottom: errorMsg.trim().length > 60 ? (0, utils_1.ms)(-25) : (0, utils_1.ms)(-10), left: 0, }, fontSize: (0, utils_1.fontSz)(14), fontFamily: "Gordita-Regular", fontWeight: "400", text: `${errorMsg}`, color: utils_1.Colors.error })), errorMsg.length === 0 && (beneficiary === null || beneficiary === void 0 ? void 0 : beneficiary.length) > 0 && ((0, jsx_runtime_1.jsx)(react_native_1.View, Object.assign({ style: [ { position: 'absolute', bottom: (0, utils_1.ms)(-10), width: '100%', // left: 0, }, ] }, { children: (0, jsx_runtime_1.jsx)(react_native_1.View, Object.assign({ style: [utils_1.globalStyles.rowBetween, { width: '100%' }] }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { fontSize: (0, utils_1.fontSz)(14), fontFamily: "Gordita-Regular", fontWeight: "400", text: `${(0, utils_1.capitalizeText)(beneficiary)}`, color: utils_1.Colors.inputBackground }) })) })))] }))); }; exports.default = (0, react_1.forwardRef)(AccountNumberInput);