ealush / emoji-picker-react

The most popular React Emoji Picker
https://ealush.com/emoji-picker-react/
MIT License
1.08k stars 176 forks source link

Mapping emoji names to emoji's #249

Open nuclearwinterr opened 2 years ago

nuclearwinterr commented 2 years ago

Thank you very much for the effort you put into this library. I'm working on a project when I need to translate emoji names back to emoji's, so grinning_face -> 😀. src/emoji.json seems to be perfect for this kind of job but AFAIK it's not exported by the library. Are there any plans to export this file or provide an interface for translating emoji names to unicode ?

nuclearwinterr commented 2 years ago

I've just made a PR ( #250 ) for a quick solution to this.

jgtvares commented 2 years ago

This feature would be great! As a workaround to this, my app uploads a JSON file to an S3 bucket, with name as key and emoji as value, whenever the user picks an emoji. This way, I can easily relate the emoji name and image.

nuclearwinterr commented 2 years ago

@jgtvares thanks for your input. Interesting solution you have there. Our solution was to switch up to emoji-mart which has slightly more powerful capabilities and personally I fuck with that UI. Have a good day/evening.

jgtvares commented 2 years ago

@nuclearwinterr interesting! This emoji-mart seems to be a more active and commonly used project. Is the migration easy? Are the components too different? Can you tell me more about your experience comparing both? I'll probably consider a migration too.

nuclearwinterr commented 2 years ago

@jgtvares emoji-mart is written in HTML5 and ES6, pretty standard tech (well) so you can build a wrapper around it anywhere. Putting it in a react component is straightforward and I guess they have an example for it.

The issues I encountered were that when I ran npm install, the library's index.js was not transpiled and that led to some issues with react-scripts 4. Check more here. Didn't have any more issues tho, but that's just me.

Good luck.

jgtvares commented 2 years ago

@nuclearwinterr thanks! I'll do some tests and see how it goes!