New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question Regarding customising Input Toolbar Design #662

Closed
pavanmehta91 opened this Issue Dec 12, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@pavanmehta91

pavanmehta91 commented Dec 12, 2017

How to pass style props to Input Toolbar Design to customize it's color and other style properties

Additional Information

  • React Native version: 0.47
  • react-native-gifted-chat version: 0.3
  • Platform(s) (iOS, Android, or both?): Both
@mafiusu

This comment has been minimized.

Show comment
Hide comment
@mafiusu

mafiusu Dec 12, 2017

You could copy the InputToolbar.js in the src folder and render your Edited InputToolbar.js in the renderInputToolbar prop of the GiftedChat. Basically it will look like this.



<GiftedChat
     renderInputToolbar={this.renderInputToolbar} 
/>

renderInputToolbar(props){
     // Here you will return your custom InputToolbar.js file you copied before and include with your stylings, edits.
     return (){
          <InputToolbar {...props} />
     }
}

mafiusu commented Dec 12, 2017

You could copy the InputToolbar.js in the src folder and render your Edited InputToolbar.js in the renderInputToolbar prop of the GiftedChat. Basically it will look like this.



<GiftedChat
     renderInputToolbar={this.renderInputToolbar} 
/>

renderInputToolbar(props){
     // Here you will return your custom InputToolbar.js file you copied before and include with your stylings, edits.
     return (){
          <InputToolbar {...props} />
     }
}

@pavanmehta91

This comment has been minimized.

Show comment
Hide comment
@pavanmehta91

pavanmehta91 commented Dec 13, 2017

Thanks

@xcarpentier

This comment has been minimized.

Show comment
Hide comment
@xcarpentier

xcarpentier Dec 21, 2017

Collaborator

I close this issue but create a FAQ in readme to refer it: https://github.com/FaridSafi/react-native-gifted-chat#questions

Collaborator

xcarpentier commented Dec 21, 2017

I close this issue but create a FAQ in readme to refer it: https://github.com/FaridSafi/react-native-gifted-chat#questions

@nadbm

This comment has been minimized.

Show comment
Hide comment
@nadbm

nadbm Mar 8, 2018

I'll add on to the answer that the styles can be overridden without copying the whole component:

import { GiftedChat, InputToolbar } from 'react-native-gifted-chat'
//Note that I'm just importing the InputToolbar
<GiftedChat
     renderInputToolbar={this.renderInputToolbar} 
/>

  renderInputToolbar (props) {
     //Add the extra styles via containerStyle
    return <InputToolbar {...props} containerStyle={{borderTopWidth: 1.5, borderTopColor: '#333'}} />
  }

nadbm commented Mar 8, 2018

I'll add on to the answer that the styles can be overridden without copying the whole component:

import { GiftedChat, InputToolbar } from 'react-native-gifted-chat'
//Note that I'm just importing the InputToolbar
<GiftedChat
     renderInputToolbar={this.renderInputToolbar} 
/>

  renderInputToolbar (props) {
     //Add the extra styles via containerStyle
    return <InputToolbar {...props} containerStyle={{borderTopWidth: 1.5, borderTopColor: '#333'}} />
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment