forked from shoutem/ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTextInput.js
40 lines (34 loc) · 1020 Bytes
/
TextInput.js
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
34
35
36
37
38
39
40
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { TextInput as RNTextInput } from 'react-native';
import { connectStyle } from '@shoutem/theme';
import { connectAnimation } from '@shoutem/animation';
class TextInput extends Component {
render() {
const { props } = this;
const style = {
...props.style,
};
delete style.placeholderTextColor;
delete style.selectionColor;
delete style.underlineColorAndroid;
return (
<RNTextInput
{...props}
style={style}
placeholderTextColor={props.style.placeholderTextColor}
selectionColor={props.style.selectionColor}
underlineColorAndroid={props.style.underlineColorAndroid}
/>
);
}
}
TextInput.propTypes = {
...RNTextInput.propTypes,
style: PropTypes.object,
};
const AnimatedTextInput = connectAnimation(TextInput);
const StyledTextInput = connectStyle('shoutem.ui.TextInput')(AnimatedTextInput);
export {
StyledTextInput as TextInput,
};