-
Notifications
You must be signed in to change notification settings - Fork 273
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
bug: defaultMinimalEmojis not rendering correctly #1935
Comments
Hey @tomSidebar, thank you for submitting the issue - just tested it myself and the implementation of custom reactions is quite unintuitive and with our current setup does not allow the combination of Stream-selected reactions and your custom ones due to different sprites used to render these. If you're fine with ditching our pre-selected reactions with custom id's then all you need to do is provide list of valid reaction id's from stream-emoji.json (keys from "emojis" object). You'd then do something like this: const customReactions = [
{ id: '100' },
{ id: '1234' },
{ id: 'grinning' },
// ...other emojis if you want
];
// pass it down to your custom components (exactly how you did it in your snippet) Which would look something like this: And the data that represents it will look something like this (notice the This would mean that all of the previously submitted reactions which were stored under our custom id's ( Edit: I was able to find "aliases" key which allows us to map our custom id's to EmojiMart's valid counterparts. I'm currently working on a fix (and documentation adjustment) that should resolve this issue and allow integrators to use the combination of our default minimal emoji set and their custom sets - if everything goes according to plan, we should be able to release the fix by the end of this week. Hope this helps, thanks again. Let me know if you have any other questions. |
Thanks for the explanation! Ideally we'd want the previous reactions to persist with this the addition of the extra emoji, so it sounds like your suggested fix will not quite fit our use case. But that's great news with the proposed fix, that should resolve our issue. Thank you for working on that, looking forward to using that! |
Hey, @tomSidebar, after drafting a "patchy" solution and talking to the team we decided to go an extra mile and redesign the API as the drafted solution - while easier - is also, unfortunately, a breaking change. So if we're going to introduce a breaking change, then we'd like to be sure that we don't have to tamper with it any more in the future. The new solution should be much simpler, easy to transition to and easy to modify if needed. I'll attach this issue to the new PR once it's drafted so you can keep up with the progress. |
BREAKING CHANGE: `reactionOptions` signature has changed, see release guide for more information ### 🎯 Goal Refactor and fix the way reactions work, introduce new way of customizing with better DX. Fixes: #1935 Closes: #1637 Closes: #1437 Closes: #2159 Closes: GetStream/stream-chat-react-native#2023 ### 🛠 Implementation details - ditch EmojiMart implementation, use native/sprite-sheet solution
BREAKING CHANGE: `reactionOptions` signature has changed, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information Refactor and fix the way reactions work, introduce new way of customizing with better DX. Fixes: #1935 Closes: #1637 Closes: #1437 Closes: #2159 Closes: GetStream/stream-chat-react-native#2023 - ditch EmojiMart implementation, use native/sprite-sheet solution
Refactor and fix the way reactions work, introduce new way of customizing with better DX. Fixes: #1935 Closes: #1637 Closes: #1437 Closes: #2159 Closes: GetStream/stream-chat-react-native#2023 - ditch EmojiMart implementation, use native/sprite-sheet solution BREAKING CHANGE: `reactionOptions` signature has changed, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information
## [11.0.0](v10.20.1...v11.0.0) (2023-11-27) ### ⚠ BREAKING CHANGES * **emoji-mart:** `EmojiPicker` & `EmojiIndex` signatures changed, `EmojiIndex` has been renamed to `emojiSearchIndex`, both `EmojiPicker` & `emojiSearchIndex` are now optional, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information * **emoji-mart:** `useImageFlagEmojisOnWindow` flag now requires extra style sheet import, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information * **emoji-mart:** `reactionOptions` signature has changed, see [release guide](https://github.com/GetStream/stream-chat-react/blob/v11.0.0/docusaurus/docs/React/release-guides/upgrade-to-v11.mdx) for more information * the first argument to `doSendMessageRequest` is now Channel instance instead of `Channel.cid` * apply the remark plugins `keepLineBreaksPlugin`, `htmlToTextPlugin` as a part of the default message text parsing, upgrade `unified` libraries ### Bug Fixes * **emoji-mart:** new reactions ([#1947](#1947)) ([14bef23](14bef23)), closes [#1935](#1935) [#1637](#1637) [#1437](#1437) [#2159](#2159) * **emoji-mart:** simplify EmojiPicker & emojiSearchIndex ([#2117](#2117)) ([a6e0a87](a6e0a87)), closes [#2116](#2116) [#2094](#2094) ### Features * apply keepLineBreaksPlugin & htmlToTextPlugin plugins to text rendering by default ([#2169](#2169)) ([e8047f2](e8047f2)), closes [#2170](#2170) [/github.com/GetStream/stream-chat-react/blob/f0bc7ba2532760cabb1db01e685a35bd3b0b64c5/src/components/Message/renderText/renderText.tsx#L158](https://github.com/GetStream//github.com/GetStream/stream-chat-react/blob/f0bc7ba2532760cabb1db01e685a35bd3b0b64c5/src/components/Message/renderText/renderText.tsx/issues/L158) * export MessageListNotifications and LinkPreviewList components and component props ([#2181](#2181)) ([a5a7e5a](a5a7e5a)) * require Channel instance as the first argument to doSendMessageRequest ([#2171](#2171)) ([2a06b88](2a06b88)) ### Chores * **deps:** bump stream-chat from 8.14.0 to 8.14.2 ([#2179](#2179)) ([4e6a59d](4e6a59d)) * **deps:** bump stream-chat from 8.14.2 to 8.14.3 ([#2185](#2185)) ([3dd8dab](3dd8dab))
🎉 This issue has been resolved in version 11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the bug
I am trying to add an emoji to the list of default message reactions. I followed Stream's official guide and also followed this bug report. I was able to add the extra emoji but then the fetched list of
defaultMinimalEmojis
is not rendering at all (with the exception of the angry emoji, see the screenshot below). The reaction counts are showing up correctly though and you can still react/unreact, it's just that the emojis themselves are not getting rendered.My basic setup is as follows:
I also tried hardcoding the emojis based on different emoji options they have in their code base: from emojiData.ts, from utils.ts and from SocialReactionList.tsx. None of those steps worked.
Long story short, how do I get the default emojis to show up? Or is there a way to fetch them from somewhere else?
To Reproduce
See the description above.
Expected behavior
I want the default emojis to show up correctly.
Screenshots
Package version
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: