You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Support emoji category for reaction input (#1206)
# Changelog
- Added support for EmojiCategory. You can now filter emojis for
different messages when adding Reactions to a message.
- Added `filterEmojiCategoryIds` to `GroupChannelProvider` and
`ThreadProvider`.
- How to Use
```
const filterEmojiCategoryIds = (message: SendableMessage) => {
if (message.customType === 'emoji_category_2') return [2];
return [1];
}
<GroupChannel
filterEmojiCategoryIds={filterEmojiCategoryIds}
/>
```
- Note: You need to set your custom EmojiCategory using [Sendbird
Platform
API](https://sendbird.com/docs/chat/platform-api/v3/message/reactions-and-emojis/reactions-and-emojis-overview)
in advance.
# Description
## Goal
* Customer requested that they be able to show different emojis for
different EmojiCategories.
* e.g. show different EmojiCategory when a message is sent by a bot,
versus when a message is sent by non-bot users.
## Requirements & Spec
* Users can leverage a new custom property to customize the reaction
menu bar for each message. This property allows filtering specific emoji
categories based on conditions, such as the `custom_type` attribute of a
message.
* Existing reactions from previous versions will remain visible,
although they will not appear on the reaction menu bar in the updated
version to ensure a seamless transition.
## Approach
* ` filterEmojiCategoryIds: (message: SendableMessageType) =>
EmojiCategory['id'][];` has been introduced in `GroupChannelProvider`
and `ThreadProvider`, as well as the relevant UI components. This
function:
* Can be configured at the provider level and propagated via props to
individual UI components.
* Accepts a message as a parameter and returns an array of
EmojiCategory['id'], dictating which emoji categories are permissible
for display on the reaction menu bar.
* Operates internally within the reaction bar component to exclude
emojis whose categories are not listed in the return array.
## Open Questions
* Is `filterEmojiCategoryIds` the optimal approach for user-driven
customization of this component, or should we consider introducing a
`render~~~()` property for greater flexibility?
* Any other tasks to extend public interface?
0 commit comments