-
Notifications
You must be signed in to change notification settings - Fork 836
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
[WIP] Add support for custom emojis #85
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is important if custom emojis don’t specify any emoticons, for example.
<Preview /> calls getData() itself which will fail for custom emojis because there is no universally available data source for custom emojis. To work around this, we pass the custom emoji data (which <Picker /> received via the `custom` prop) directly to <Preview />.
This is important when hovering over a custom emoji while searching.
Awesome. I’ll take a look either later today or perhaps this weekend. |
No worries. I’ll also need to make sure that it works fine with other props such as |
So that custom emojis can also be filtered if need be
Welp, I think that’s it! That’s amazing, thank you so much! 🤘 |
Thank you for implementing the rest of the necessary changes and for releasing v1.0.0 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2. Even though this already works, I’m not sure if I’m happy with some of the internal changes (hence the
[WIP]
). @EtienneLem Let me know what you think.An overview of the internal changes I made to support custom emojis:
search
property is now split out into a separate file so we can use it from bothscripts/build-data.js
andsrc/utils
.<Emoji />
supports custom emojis by checking theemoji.custom
property and usingemoji.imageUrl
to display it (the props themselves remain unchanged).<Picker />
passes an already sanitizedemoji
object to<Preview />
it failed for custom emojis. To work around this, I merge the originalemoji
object (which was passed in via thecustom
prop) before passing it on to<Preview />
inhandleEmojiOver()
.EmojiIndex#search
now accepts acustom
property which will add those emojis todata.emojis
,data.categories
, andemojisList
so that the rest ofEmojiIndex#search
works without any changes.For the moment, I have opted for
I18N
. If we allow a custom image for the custom category, I think it would make sense to allow custom images for all categories. I’d therefore suggest a prop akin tobackgroundImageFn
, maybeanchorImageFn
.