-
Notifications
You must be signed in to change notification settings - Fork 119
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
Adding nextMessage prop to UserMessage in the Theme editor #464
Comments
Hi, Steven from the TalkJS dev team here. Thanks for opening this issue, you really clearly explained your problem. From my own hacking around with the theme editor, I think it is possible in theory to style the last consecutive message from the same user differently, by abusing css selectors in ways we never really expected when making the theme editor However, that's not really something I'd ever suggest for you to do in prod. I definitely see the need for 'nextMessage', and don't think there's any realistic workaround for it. I've raised this feature request internally, and I'll let you know any updates |
I don't know if this is the right forum for this, so let me know if there is a better place to post this.
When using the theme editor, there is currently a prop called previousMessage that is very useful for knowing if the message is the first from a user, which allows you to for example only show the Avatar if it's the first message from a user, in this way
But there is no way (or at least that I can find) that allows you to the same thing but having it only for the last message. So for only showing the Avatar for the message if it is the last message instead of the first, this is for example how Instagram has it. Also, this would be very useful for styling messages like Instagram with different border-radiuses for only the first and last message of the group, like the image below. Which is what I want here, as I'm trying to make an Instagram clone for the chat and this seems pretty impossible at the moment
I think a nextMessage prop would solve this very easily as it could be used just like previousMessage is working now but the reverse. Im open to solving this another way, but i think this solution makes sense and should not be difficult to add (but could also very easily be wrong)
The text was updated successfully, but these errors were encountered: