missive / emoji-mart

šŸŖ One component to pick them all
https://missiveapp.com/open/emoji-mart
MIT License
8.59k stars 828 forks source link

How to hide categories title ? #768

Open loycoder opened 1 year ago

loycoder commented 1 year ago
image
redstar08 commented 1 year ago

@loycoder Here's an equivalent solution.

Code Location

https://github.com/missive/emoji-mart/blob/main/packages/emoji-mart/src/components/Picker/Picker.tsx#L902

  1. Declare a custom i8n data like this:
export const myi18n = {
  "search": "Search",
  "search_no_results_1": "Oh no!",
  "search_no_results_2": "That emoji couldnā€™t be found",
  "pick": "Pick an emojiā€¦",
  "add_custom": "Add custom emoji",
  "categories": {
    // Define a empty categories title map.
    "activity": "",
    "custom": "",
    "flags": "",
    "foods": "",
    "frequent": "",
    "nature": "",
    "objects": ",
    "people": "",
    "places": "",
    "search": "",
    "symbols": ""
  },
  "skins": {
    "choose": "Choose default skin tone",
    "1": "Default",
    "2": "Light",
    "3": "Medium-Light",
    "4": "Medium",
    "5": "Medium-Dark",
    "6": "Dark"
  }
}
  1. Pass myi18n as i18n prop to picker.
    new Picker({
    i18n: myi18n,
    })