charkour / react-reactions

😲 Create custom reaction pickers and counters or use your favorites!
MIT License
76 stars 16 forks source link

You didn't show in custom counter #131

Closed gh4m21 closed 2 years ago

gh4m21 commented 2 years ago

Describe the bug When I try to add the custom counter and when I like the post. You didn't show up. And if 3 people like the post, for example, It shows and 2 other people.

My code:

<ReactionCounter reactions={likeArray(post?.Reactions, reactions)} important={["vens"]} user={"vens"} className="text-md text-primary" showOthersAlways={likeArray(post?.Reactions).length > 0 && post?.Reactions?.UserId === user?.id ? true : false} onClick={() => { console.log("will show pop up of person who liked it"); }} /> </p>

Expected behavior I expected to see You, you and 2 other people

Screenshots

2022-04-13 (2)

gh4m21 commented 2 years ago

code sandbox:

https://codesandbox.io/embed/react-reactions-issue-7kberm?fontsize=14&hidenavigation=1&theme=dark

charkour commented 2 years ago

Hey @gh4m21,

Thanks for the sandbox. I was able to find the issue.

The counter component is used to show a count of who liked what and list them out. I updated the data to include "vens", and removed the important prop. The counter can be used with the selector.

Sorry for the confusion. In the future, I hope to improve the documentation and make the components easier to use.

Here is a sandbox with your expected behavior. Does this do what you are hoping?

gh4m21 commented 2 years ago

Wow! Thank you so much for resolving this issue so fast for me.

Your solution was exactly what I was trying to do. I didn't know if It takes an additional parameter by.

By the way, this package is Helpful. I have another question, How can I style the emoji and the components with a custom background and style like the screenshot below?

image

charkour commented 2 years ago

That is a great question. Right now it is not possible to due with the way the library works. Sorry!

I like your suggestion and can release a new version of the package this weekend. Thanks for the great idea and for your patience!

gh4m21 commented 2 years ago

Thank you so much. Looking forward to seeing this modification on your next release this weekend.

charkour commented 2 years ago

An update to style the ReactionCounterEmoji's was released in v0.8.0!

Here is an example that styles the emoji's similar to the picture above. Does this do what you'd like it to do?

gh4m21 commented 2 years ago

An update to style the ReactionCounterEmoji's was released in v0.8.0!

Here is an example that styles the emoji's similar to the picture above. Does this do what you'd like it to do?

Thank you so so much🔥 You literally save me a lot of headache on the project I am currently working on with this updated.🔥🙌🏾

gh4m21 commented 2 years ago

An update to style the ReactionCounterEmoji's was released in v0.8.0!

Here is an example that styles the emoji's similar to the picture above. Does this do what you'd like it to do?

@charkour Sorry to bother you again. Could you please add the ability to customize the container of the ReactionBarSelector the same way you did for ReactionCounterEmoji's? I will really appreciate that.

charkour commented 2 years ago

Happy to help! Which container do you want to update? Perhaps you could post a picture or a link to the code? Thanks!

gh4m21 commented 2 years ago

Happy to help! Which container do you want to update? Perhaps you could post a picture or a link to the code? Thanks!

For example for this sandbox:

https://codesandbox.io/s/issue-react-reactions-with-mobile-touch-e7hpnd

I want to style the selector like the previous picture also. Be able to change the rounded, background...

charkour commented 2 years ago

Yes! That can be done. I'll publish an update tomorrow. Thanks for the suggestion and your patience!

You're welcome to also make a PR if you'd like. I'll plan on making this change tomorrow. Thanks and happy easter.

gh4m21 commented 2 years ago

Thanks! I am planning to make a pull request and see If I can make some update on this packages. When I have a little more time. Thanks for your help and Happy easter to you also

charkour commented 2 years ago

Okay, I will not make the change and will let you make a pull request. If you have any questions, please let me know. Thanks!

charkour commented 2 years ago

Hi @gh4m21, using the style prop with the ReactionBarSelector has been released in v0.10.0. Please let me know if there are any issues. Thanks!

gh4m21 commented 2 years ago

Hey, @charkour. Thank you for letting me know that. I will update it and use it. I was swamped on the parts of the projects, but this update came to the proper and thank you so much!

charkour commented 2 years ago

Happy to help! I hope the projects go well.