-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Added "alwaysRenderAvatar" prop to "Avatar.js" #297
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice @eomine!
Could you please update also the Readme
Props section?
BTW, it seems that this PR should be merged after #292.
@dgdavid Thanks! Changed the prop to a shorter name. Its value must be set to Updated the Readme. |
@@ -63,6 +67,7 @@ const styles = { | |||
}; | |||
|
|||
Avatar.defaultProps = { | |||
alwaysRenderAvatar: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Looks better now. I was thinking a shorter name but no idea came to my mind ;)
README.md
Outdated
@@ -118,6 +118,7 @@ See [example/App.js](example/App.js) | |||
- **`renderSend`** _(Function)_ - render the send button | |||
- **`renderAccessory`** _(Function)_ - renders a second line of actions below the message composer | |||
- **`bottomOffset`** _(Integer)_ - distance of the chat from the bottom of the screen, useful if you display a tab bar | |||
- **`alwaysRenderAvatar`** _(Bool)_ - always render the message avatar, even when consecutive messages are from same day and same user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be interesting to indicate the default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, updated the readme with the default value.
@prithsharma Looking at the code I'm not sure it will help you after all :( |
@prithsharma It would be nice to use the For example, replacing But these days I'm a little out of the loop to think/discuss the viability of this PR, so once again we need the @kfiroo support. |
092db6b
to
730bab3
Compare
Since you have now a good knowledte of project, could please take a look to this PR and give your opinion about what to do in order to fix and merge or reject it? Thanks! |
Will this eventually be merged? |
@hironarita #729 was merged |
Currently, the
Avatar
component hides the avatar of a message if it's from the same day and from the same user of the previous message.This prop allows users to disable this behavior, so that the avatar is rendered on all messages.
The default value is
false
, which keeps the current behavior.In order to render the avatar on all messages, one should set the
alwaysRenderAvatar
prop totrue
when placing theGiftedChat
component.