question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

renderInputToolbar and renderSend UI styling.

See original GitHub issue

Issue Description

Hello! I would like to style giftedchat for my app but I’m having difficulties. I can’t seem to get the inputToolbar or renderSend styling to work. See image for explanation:

Screenshot_20190913-195228

I have tried to use bottomOffset but this doesn’t seem to be having any effect. I have no idea what is causing the border around the send Icon.

Steps to Reproduce / Code Snippets

GiftedChat Code:

return (
  <View style={{flex: 1}}>
    <GiftedChat
      renderSend={this.renderSend}
      renderInputToolbar={this.renderInputToolbar}
      messages={this.state.messages}
      onSend={messages => this.onSend(messages)}
      user={{_id: 1,}} 
      renderMessage={this.renderMessage}
      alwaysShowSend={true}
    />
  </View>
)

InputToolbar Code:

renderInputToolbar (props) {
        return <InputToolbar {...props} containerStyle={styles.inputToolbar} />
      }

InputToolbar Styling:

inputToolbar: {
        marginLeft: 15,
        marginRight: 15,
        marginBottom: 10,
        borderWidth: 0.5,
        borderColor: 'grey',
        borderRadius: 25
    }

renderSend Code:

renderSend(props) {
        return (
          <Send {...props}>
              <Icon
                name="send"
                style={styles.sendIcon}
              />
          </Send>
        );
      }

sendIcon Styling:

    sendIcon: {
        fontSize: 25,
        color: '#3A97F9'
    },

Expected Results

No border around send Icon. The bottom message should not be obstructed by the input toolbar.

Additional Information

  • Nodejs version: “12.6.0”
  • React version: “16.8.6”
  • React Native version: “0.60.4”
  • react-native-gifted-chat version: “^0.9.11”
  • Platform(s) (iOS, Android, or both?): Both

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
HNCWcommented, Apr 3, 2020

This is my solution to remove the border that covers the send icon. This help solved my problem which is same as yours. The problem gifted chat does not provide the Send component props. In order to read all of the props. In windows, ctrl + left click on the <Send/> component. For mac, cmd + left click. Hope it solves your problem too

renderSend(props) { return ( <Send {…props} containerStyle={{ borderWidth: 0}} > <Icon name="send" style={styles.sendIcon} /> </Send> ); }

0reactions
gouravgoelcommented, May 14, 2021

Capture Please help how can I reduce the distance between top of the keyboard and the input toolbar

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Auto Resize React Native Gifted Chat Input?
///Pass props renderInputToolbar = (props) => { return ( <InputToolbar {...props} //Add the extra styles via containerStyle here //Add any ...
Read more >
Creating a Chat Component With React Native | by Yash Gupta
Chatting is an essential feature of any modern social. In this article, we will go through how to create a npm package for...
Read more >
react-native-gifted-chat - npm
The most complete chat UI for React Native. ... renderInputToolbar (Function) - Custom message composer container; renderComposer (Function) ...
Read more >
react-native-gifted-chat@1.1.0 - jsDocs.io
Overview. The most complete chat UI for React Native ... renderSend: null;. renderAccessory: null; ... renderInputToolbar: PropTypes.
Read more >
Chat app with React Native (part 4) - A guide to create Chat UI ...
Add the prop renderSend to <GiftedChat/> . Add corresponding styles if any. 1 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found