@dokuhero/react-native-components
Version:
Sets of React Native components that works with dokuhero/react-native-theme and react-i18next
30 lines • 1.62 kB
JavaScript
import * as tslib_1 from "tslib";
import { withTheme } from '@dokuhero/react-native-theme';
import React from 'react';
import { CalculatorInput } from 'react-native-calculator';
import { globalStyles } from '../styles';
import { FormField } from './FormField';
export var InputCurrency = withTheme(function (_a) {
var currency = _a.currency, value = _a.value, label = _a.label, errors = _a.errors, onChange = _a.onChange, theme = _a.theme, fieldTextStyle = _a.fieldTextStyle, containerStyle = _a.containerStyle, disabled = _a.disabled, rest = tslib_1.__rest(_a, ["currency", "value", "label", "errors", "onChange", "theme", "fieldTextStyle", "containerStyle", "disabled"]);
return (<FormField label={label} errors={errors} containerStyle={[containerStyle, { paddingRight: 10 }]}>
<CalculatorInput disabled={disabled} fieldDisabledTextStyle={{
color: theme.color.grey,
fontFamily: theme.fontName.semiBold
}} value={value} fieldContainerStyle={[
{
marginLeft: 20,
borderBottomColor: theme.color.grey
},
disabled ? { borderBottomWidth: 0 } : {}
]} fieldTextStyle={[
globalStyles.inputText,
{ marginBottom: 6 },
fieldTextStyle
]} borderColor={theme.color.lighter} acceptButtonBackgroundColor={theme.color.primary} calcButtonBackgroundColor={theme.color.secondary} prefix={(currency || 'Rp') + ' '} onChange={function (val) {
if (onChange) {
onChange(val);
}
}} height={300} {...rest}/>
</FormField>);
});
//# sourceMappingURL=InputCurrency.js.map