Skip to content
Open
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
25 changes: 14 additions & 11 deletions components/TextInput.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { TextInput as RNTextInput } from 'react-native';
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';
import { connectStyle } from "@shoutem/theme";
import { connectAnimation } from "@shoutem/animation";

class TextInput extends Component {
render() {
const { props } = this;
const style = {
...props.style,
...props.style
};
delete style.placeholderTextColor;
delete style.selectionColor;
Expand All @@ -19,6 +19,11 @@ class TextInput extends Component {
<RNTextInput
{...props}
style={style}
ref={input => {
if (typeof this.props.inputRef === "function") {
this.props.inputRef(input);
}
}}
placeholderTextColor={props.style.placeholderTextColor}
selectionColor={props.style.selectionColor}
underlineColorAndroid={props.style.underlineColorAndroid}
Expand All @@ -29,12 +34,10 @@ class TextInput extends Component {

TextInput.propTypes = {
...RNTextInput.propTypes,
style: PropTypes.object,
style: PropTypes.object
};

const AnimatedTextInput = connectAnimation(TextInput);
const StyledTextInput = connectStyle('shoutem.ui.TextInput')(AnimatedTextInput);
const StyledTextInput = connectStyle("shoutem.ui.TextInput")(AnimatedTextInput);

export {
StyledTextInput as TextInput,
};
export { StyledTextInput as TextInput };