-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat(CLNP-2026): support reactions for super group channel #159
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #159 +/- ##
==========================================
- Coverage 13.01% 13.00% -0.01%
==========================================
Files 334 334
Lines 7430 7434 +4
Branches 2050 2052 +2
==========================================
Hits 967 967
- Misses 6392 6396 +4
Partials 71 71 ☔ View full report in Codecov by Sentry. |
9e3de0f
to
a566725
Compare
a566725
to
8ab0720
Compare
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.
How about changing the param reactionEnabled
to config
for the shouldRenderReaction
?
// Usage
const configs = sbOptions.uikitWithAppInfo.groupChannel.channel;
shouldRenderReaction(channel, configs)
// Function
export function shouldRenderReaction(channel: SendbirdBaseChannel, configs: CustomDefinedConfigType) {
if (channel.isOpenChannel()) {
return false;
}
if (channel.isGroupChannel()) {
if (channel.isBroadcast) return false;
if (channel.isEphemeral) return false;
if (channel.isChatNotification) return false;
}
return channel.isSuper ? configs.enableReactionsSupergroup : configs.enableReactions;
}
In such cases, it's preferable to receive a single value determined externally rather than adding logic internally to handle multiple values. For example, if we need to determine the enabled status of a reaction and it requires adding a flag at the module level rather than in the config, then we should add a new parameter. This is similar to why we can pass anything to the children when rendering components. (we should not write code that brings outside events inside the house to resolve them.) |
External Contributions
This project is not yet set up to accept pull requests from external contributors.
If you have a pull request that you believe should be accepted, please contact
the Developer Relations team [email protected] with details
and we'll evaluate if we can setup a CLA to allow for the contribution.
For Internal Contributors
CLNP-2026
Description Of Changes
Add a brief description of the changes that you have involved in this PR
Types Of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that apply_