Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/components/textField/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import React, {useContext, useMemo} from 'react';
import {TextInput as RNTextInput, StyleSheet, Platform} from 'react-native';
import {Constants, ForwardRefInjectedProps} from '../../commons/new';
import {InputProps, ColorType} from './types';
import {InputProps} from './types';
import {getColorByState} from './Presenter';
import {Colors} from '../../style';
import FieldContext from './FieldContext';
import useImperativeInputHandle from './useImperativeInputHandle';

const DEFAULT_INPUT_COLOR: ColorType = {
default: Colors.$textDefault,
disabled: Colors.$textDisabled,
readonly: Colors.$textNeutral
};

const Input = ({
// (!) extract flex prop to avoid passing them on Android
// TODO: extract alignment (top, right, ...) props till we manage to exclude them from typings
Expand All @@ -30,7 +24,11 @@ const Input = ({
/* eslint-enable */
style,
hint,
color = DEFAULT_INPUT_COLOR,
color = {
default: Colors.$textDefault,
disabled: Colors.$textDisabled,
readonly: Colors.$textNeutral
},
forwardedRef,
formatter,
useGestureHandlerInput,
Expand Down