diff --git a/package.json b/package.json index 75e0ab0..2d85030 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "homepage": "https://github.com/dokuhero/react-native-components#readme", "dependencies": { - "react-native-calculator": "^0.2.2", + "react-native-calculator": "^0.2.4", "react-native-custom-picker": "^0.3.1", "react-native-elements": "^0.19.1", "react-native-super-grid": "^2.4.3", diff --git a/src/components/InputCurrency.tsx b/src/components/InputCurrency.tsx index 2588727..461dc49 100644 --- a/src/components/InputCurrency.tsx +++ b/src/components/InputCurrency.tsx @@ -1,17 +1,28 @@ import { withTheme } from '@dokuhero/react-native-theme' import React from 'react' -import { CalculatorInput } from 'react-native-calculator' +import { CalculatorInput, CalculatorInputProps } from 'react-native-calculator' import { globalStyles } from '../styles' import { FormField, FormFieldProps } from './FormField' -export interface InputCurrencyProps extends FormFieldProps { +export interface InputCurrencyProps + extends FormFieldProps, + CalculatorInputProps { currency?: string value: number onChange: (value: number) => void } export const InputCurrency = withTheme( - ({ currency, value, label, errors, onChange, theme }) => ( + ({ + currency, + value, + label, + errors, + onChange, + theme, + fieldTextStyle, + ...rest + }) => ( ( paddingBottom: 7, borderBottomColor: theme.color.lighter }} - fieldTextStyle={globalStyles.inputText} + fieldTextStyle={[globalStyles.inputText, fieldTextStyle]} borderColor={theme.color.lighter} acceptButtonBackgroundColor={theme.color.primary} calcButtonBackgroundColor={theme.color.secondary} @@ -31,6 +42,7 @@ export const InputCurrency = withTheme( } }} height={300} + {...rest} /> ) diff --git a/src/components/InputNumber.tsx b/src/components/InputNumber.tsx index 49befe4..9742c73 100644 --- a/src/components/InputNumber.tsx +++ b/src/components/InputNumber.tsx @@ -1,16 +1,16 @@ import { withTheme } from '@dokuhero/react-native-theme' import React from 'react' -import { CalculatorInput } from 'react-native-calculator' +import { CalculatorInput, CalculatorInputProps } from 'react-native-calculator' import { globalStyles } from '../styles' import { FormField, FormFieldProps } from './FormField' -export interface InputNumberProps extends FormFieldProps { +export interface InputNumberProps extends FormFieldProps, CalculatorInputProps { value: number onChange: (value: number) => void } export const InputNumber = withTheme( - ({ value, label, errors, onChange, theme }) => ( + ({ value, label, errors, onChange, theme, fieldTextStyle, ...rest }) => ( ( paddingBottom: 7, borderBottomColor: theme.color.lighter }} - fieldTextStyle={globalStyles.inputText} + fieldTextStyle={[globalStyles.inputText, fieldTextStyle]} borderColor={theme.color.lighter} acceptButtonBackgroundColor={theme.color.primary} calcButtonBackgroundColor={theme.color.secondary} @@ -29,6 +29,7 @@ export const InputNumber = withTheme( } }} height={300} + {...rest} /> ) diff --git a/yarn.lock b/yarn.lock index d53c70d..5b9d2f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3617,9 +3617,9 @@ react-native-branch@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/react-native-branch/-/react-native-branch-2.2.5.tgz#4074dd63b4973e6397d9ce50e97b57c77a518e9d" -react-native-calculator@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/react-native-calculator/-/react-native-calculator-0.2.2.tgz#ab3b9bcca934cae090ca859a1f6b79a2414d29aa" +react-native-calculator@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/react-native-calculator/-/react-native-calculator-0.2.4.tgz#b0c9bc1fa1324d96e25d4636605948958ac8be44" react-native-custom-picker@^0.3.1: version "0.3.1"