charkour / react-reactions

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

Slack add reaction shows empty box #123

Closed michaelshum closed 2 years ago

michaelshum commented 2 years ago

The default "add reaction" button (SlackSelector) in SlackCounterGroup is an empty box even after downloading fonts/slack-icons-Regular.ttf and fonts/slack-icons-Regular.woff in public/.

empty

However, it shows up after clicking the SlackSelector:

with reaction

Is there something else we need to do to include the emoji?

Expected behavior I would expect the add reaction button to include required fonts without selecting the SlackSelector.

Screenshots Included in-line

Desktop (please complete the following information):

Smartphone (please complete the following information):

charkour commented 2 years ago

Hey @michaelshum, thanks for reporting this!

Could you provide a stackblitz or code sandbox with the reproduced issue? That will help me quickly diagnose the issue. Thanks!

michaelshum commented 2 years ago

Hey @charkour, here (https://codesandbox.io/s/optimistic-ully-gdmxd4?file=/pages/reactions.js) is a code sandbox with this issue, as well as the one I mentioned in https://github.com/charkour/react-reactions/issues/120.

In https://gdmxd4.sse.codesandbox.io/reactions you can see this issue: empty box before clicking, then after clicking it has the reaction emoji.

In https://gdmxd4.sse.codesandbox.io/subfolder/reactions you can see the other issue: it is an empty box before and after clicking. You can also see that the SlackSelector header is also a row of empty boxes in this case.

charkour commented 2 years ago

Perfect. Thank you! I can take a look soon.

michaelshum commented 2 years ago

Hey @charkour, adding to this issue as I assume they're related: on Safari on iOS the default box is a maple leaf instead of an empty box

image
charkour commented 2 years ago

Haha very interesting. Seems to be a bug. I have some time today and will work on a fix. Thanks for reporting!

charkour commented 2 years ago

I tried to fix it and released version 0.6.2, but that did not seem to work. I updated the version on CodeSandbox and it breaks it even more.

charkour commented 2 years ago

Will continue to try to get it to work.

charkour commented 2 years ago

Thanks for your patience. This was fixed in v0.6.3 to include the Slack fonts in both the Counter and Selector component.

Thanks for reporting the issue!

michaelshum commented 2 years ago

Hey @charkour, thanks for the update. However now I'm getting that the emoji selection window doesn't have any emojis? Attaching a screenshot below:

image
charkour commented 2 years ago

Oh yes. I knew something looked off.

Thanks, I can take a look tomorrow unless you'd like to!

charkour commented 2 years ago

Note to self: I think it has to do with the SlackCSS component. It should be separated into one that is for the Selector and one that is for the Fonts

charkour commented 2 years ago

A fix was released in v0.6.4. It was a regression I have naively caused in v0.6.2. Sorry and thanks for reporting!

michaelshum commented 2 years ago

Thanks @charkour! Works for me now 🙏

One related item I asked about in https://github.com/charkour/react-reactions/issues/120#issuecomment-1053749740 is that for files using SlackSelector in subdirectories (eg /subdir), I need to make a copy of the font files in my public folder (eg /public/subdir/fonts/slack-icons-Regular.ttf) to have it render properly. (Separately, I'm also making a copy of these files in /public/fonts).

I'm using Next.js - could this be a quirk of the framework, or am I missing the right way to import fonts correctly? Thanks very much.

charkour commented 2 years ago

Unfortunately, that's currently the right solution. When I ported over the old react reactions lib, it handled fronts this way. In the future, I'll aim to make it easier to use!

Sorry for the current inconvenience, but that's the proper way for now.