Skip to content

Commit

Permalink
allow renderTextInput to customize text input
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlo Aksonov committed May 27, 2016
1 parent e8339a3 commit 74276ab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.DS_Store
node_modules/
npm-debug.log
.idea
10 changes: 9 additions & 1 deletion GiftedMessenger.js
Expand Up @@ -505,7 +505,7 @@ class GiftedMessenger extends Component {
styles={this.styles}
/>
</View>
);
);
}

renderAnimatedView() {
Expand Down Expand Up @@ -558,6 +558,14 @@ class GiftedMessenger extends Component {
}

renderTextInput() {
if (this.props.renderTextInput){
return this.props.renderTextInput({
...this.props,
...this.state,
onSend:this.onSend,
onChangeText:this.onChangeText
});
}
if (this.props.hideTextInput === false) {
return (
<View style={this.styles.textInputContainer}>
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -74,6 +74,7 @@ See [GiftedMessengerExample/GiftedMessengerContainer.js](https://raw.githubuserc
| placeholder | String | TextInput placeholder | Both | 'Type a message...' |
| placeholderTextColor | String | TextInput text color placeholder | Both | '#ccc' |
| renderCustomText | Function | Implement your own text rendering | Both | (rowData) => {} |
| renderTextInput | Function | Implement your own text input rendering | Both | (props) => {} |
| renderCustomDate | Function | Implement your own date rendering | Both | (rowData, previousData) => {} |
| scrollAnimated | Boolean | do animation when scrolling | Both | true |
| sendButtonText | String | 'Send' button label | Both | 'Send' |
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-gifted-messenger",
"version": "0.1.4",
"version": "0.1.5",
"description": "Chat UI for iOS and Android React-Native apps",
"main": "GiftedMessenger.js",
"scripts": {
Expand Down

0 comments on commit 74276ab

Please sign in to comment.