1
1
import React , { useContext , useMemo } from 'react' ;
2
2
import { TextInput as RNTextInput , StyleSheet , Platform } from 'react-native' ;
3
3
import { Constants , ForwardRefInjectedProps } from '../../commons/new' ;
4
- import { InputProps , ColorType } from './types' ;
4
+ import { InputProps } from './types' ;
5
5
import { getColorByState } from './Presenter' ;
6
6
import { Colors } from '../../style' ;
7
7
import FieldContext from './FieldContext' ;
8
8
import useImperativeInputHandle from './useImperativeInputHandle' ;
9
9
10
- const DEFAULT_INPUT_COLOR : ColorType = {
11
- default : Colors . $textDefault ,
12
- disabled : Colors . $textDisabled ,
13
- readonly : Colors . $textNeutral
14
- } ;
15
-
16
10
const Input = ( {
17
11
// (!) extract flex prop to avoid passing them on Android
18
12
// TODO: extract alignment (top, right, ...) props till we manage to exclude them from typings
@@ -30,7 +24,11 @@ const Input = ({
30
24
/* eslint-enable */
31
25
style,
32
26
hint,
33
- color = DEFAULT_INPUT_COLOR ,
27
+ color = {
28
+ default : Colors . $textDefault ,
29
+ disabled : Colors . $textDisabled ,
30
+ readonly : Colors . $textNeutral
31
+ } ,
34
32
forwardedRef,
35
33
formatter,
36
34
useGestureHandlerInput,
0 commit comments