Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 2x 18x 18x 2x | import React, { forwardRef } from 'react';
import { TextInput, View } from 'react-native';
import { InputProvider, InputTooltip, InputWrapper } from './Components';
import { InputNativeProps } from '../Input.types';
const Input = forwardRef<TextInput, InputNativeProps>((props, ref) => {
const { tooltip, tooltipOptions } = props;
return (
<InputProvider statusValue={props.status || 'default'} sizeProps={props.size || 'default'}>
<View style={{ position: 'relative' }}>
<InputWrapper {...props} ref={ref} />
{tooltip && tooltipOptions?.trigger === 'always' && (
<InputTooltip
id={props.id || 'input-tooltip'}
message={tooltip}
bgColor={tooltipOptions?.bgColor || 'red'}
pointerDirection={tooltipOptions?.pointerDirection || 'left'}
isVisible={true}
className={tooltipOptions?.className || ''}
style={tooltipOptions?.style || {}}
/>
)}
</View>
</InputProvider>
);
});
Input.displayName = 'Input';
export { Input };
|