Remove localization from emotes and make all names lower case by default
This commit is contained in:
parent
50550bfa99
commit
78fde47577
3 changed files with 84 additions and 84 deletions
|
@ -44,7 +44,7 @@ export default function EmoteSelector(props: Props) {
|
|||
/>
|
||||
))}
|
||||
{EMOTES.map((emote) => {
|
||||
const emoteName = emote.name.toLowerCase();
|
||||
const emoteName = emote.name;
|
||||
|
||||
return (
|
||||
<Button
|
||||
|
|
|
@ -131,7 +131,7 @@ export default function TextareaWithSuggestions(props: Props) {
|
|||
let emojiNames;
|
||||
const allOptions = [];
|
||||
if (isEmote) {
|
||||
emoteNames = EMOTES.map(({ name }) => name.toLowerCase());
|
||||
emoteNames = EMOTES.map(({ name }) => name);
|
||||
const hasMinEmojiLength = suggestionTerm && suggestionTerm.length > EMOJI_MIN_CHARACTERS;
|
||||
// Filter because our emotes are priority from default emojis, like :eggplant:
|
||||
emojiNames = hasMinEmojiLength ? EMOJIS.names.filter((name) => !emoteNames.includes(`:${name}:`)) : [];
|
||||
|
@ -357,7 +357,7 @@ export default function TextareaWithSuggestions(props: Props) {
|
|||
};
|
||||
|
||||
const renderOption = (optionProps: any, label: string) => {
|
||||
const emoteFound = isEmote && EMOTES.find(({ name }) => name.toLowerCase() === label);
|
||||
const emoteFound = isEmote && EMOTES.find(({ name }) => name === label);
|
||||
const emoteValue = emoteFound ? { name: label, url: emoteFound.url } : undefined;
|
||||
const emojiFound = isEmote && EMOJIS.getUnicode(label);
|
||||
const emojiValue = emojiFound ? { name: label, unicode: emojiFound } : undefined;
|
||||
|
|
|
@ -3,91 +3,91 @@
|
|||
const buildCDNUrl = (path: string) => `https://static.odycdn.com/emoticons/${path}`;
|
||||
|
||||
const buildEmote = (name: string, path: string) => ({
|
||||
name: __(`:${name}:`),
|
||||
name: `:${name}:`,
|
||||
url: buildCDNUrl(path),
|
||||
});
|
||||
|
||||
const getEmotes = (px: string, multiplier: string) => [
|
||||
buildEmote('ALIEN', `${px}/Alien${multiplier}.png`),
|
||||
buildEmote('ANGRY_1', `${px}/angry${multiplier}.png`),
|
||||
buildEmote('ANGRY_2', `${px}/angry%202${multiplier}.png`),
|
||||
buildEmote('ANGRY_3', `${px}/angry%203${multiplier}.png`),
|
||||
buildEmote('ANGRY_4', `${px}/angry%204${multiplier}.png`),
|
||||
buildEmote('BLIND', `${px}/blind${multiplier}.png`),
|
||||
buildEmote('BLOCK', `${px}/block${multiplier}.png`),
|
||||
buildEmote('BOMB', `${px}/bomb${multiplier}.png`),
|
||||
buildEmote('BRAIN_CHIP', `${px}/Brain%20chip${multiplier}.png`),
|
||||
buildEmote('CONFIRM', `${px}/CONFIRM${multiplier}.png`),
|
||||
buildEmote('CONFUSED_1', `${px}/confused${multiplier}-1.png`),
|
||||
buildEmote('CONFUSED_2', `${px}/confused${multiplier}.png`),
|
||||
buildEmote('COOKING_SOMETHING_NICE', `${px}/cooking%20something%20nice${multiplier}.png`),
|
||||
buildEmote('CRY_1', `${px}/cry${multiplier}.png`),
|
||||
buildEmote('CRY_2', `${px}/cry%202${multiplier}.png`),
|
||||
buildEmote('CRY_3', `${px}/cry%203${multiplier}.png`),
|
||||
buildEmote('CRY_4', `${px}/cry%204${multiplier}.png`),
|
||||
buildEmote('CRY_5', `${px}/cry%205${multiplier}.png`),
|
||||
buildEmote('DONUT', `${px}/donut${multiplier}.png`),
|
||||
buildEmote('EGGPLANT_WITH_CONDOM', `${px}/eggplant%20with%20condom${multiplier}.png`),
|
||||
buildEmote('EGGPLANT', `${px}/eggplant${multiplier}.png`),
|
||||
buildEmote('FIRE_UP', `${px}/fire%20up${multiplier}.png`),
|
||||
buildEmote('FLAT_EARTH', `${px}/Flat%20earth${multiplier}.png`),
|
||||
buildEmote('FLYING_SAUCER', `${px}/Flying%20saucer${multiplier}.png`),
|
||||
buildEmote('HEART_CHOPPER', `${px}/heart%20chopper${multiplier}.png`),
|
||||
buildEmote('HYPER_TROLL', `${px}/HyperTroll${multiplier}.png`),
|
||||
buildEmote('ICE_CREAM', `${px}/ice%20cream${multiplier}.png`),
|
||||
buildEmote('IDK', `${px}/IDK${multiplier}.png`),
|
||||
buildEmote('ILLUMINATI_1', `${px}/Illuminati${multiplier}-1.png`),
|
||||
buildEmote('ILLUMINATI_2', `${px}/Illuminati${multiplier}.png`),
|
||||
buildEmote('KISS_1', `${px}/kiss${multiplier}.png`),
|
||||
buildEmote('KISS_2', `${px}/kiss%202${multiplier}.png`),
|
||||
buildEmote('LASER_GUN', `${px}/laser%20gun${multiplier}.png`),
|
||||
buildEmote('LAUGHING_1', `${px}/Laughing${multiplier}.png`),
|
||||
buildEmote('LAUGHING_2', `${px}/Laughing 2${multiplier}.png`),
|
||||
buildEmote('LOLLIPOP', `${px}/Lollipop${multiplier}.png`),
|
||||
buildEmote('LOVE_1', `${px}/Love${multiplier}.png`),
|
||||
buildEmote('LOVE_2', `${px}/Love%202${multiplier}.png`),
|
||||
buildEmote('MONSTER', `${px}/Monster${multiplier}.png`),
|
||||
buildEmote('MUSHROOM', `${px}/mushroom${multiplier}.png`),
|
||||
buildEmote('NAIL_IT', `${px}/Nail%20It${multiplier}.png`),
|
||||
buildEmote('NO', `${px}/NO${multiplier}.png`),
|
||||
buildEmote('OUCH', `${px}/ouch${multiplier}.png`),
|
||||
buildEmote('PIZZA', `${px}/pizza${multiplier}.png`),
|
||||
buildEmote('PREACE', `${px}/peace${multiplier}.png`),
|
||||
buildEmote('RABBIT_HOLE', `${px}/rabbit%20hole${multiplier}.png`),
|
||||
buildEmote('RAINBOW_PUKE_1', `${px}/rainbow%20puke${multiplier}-1.png`),
|
||||
buildEmote('RAINBOW_PUKE_2', `${px}/rainbow%20puke${multiplier}.png`),
|
||||
buildEmote('ROCK', `${px}/ROCK${multiplier}.png`),
|
||||
buildEmote('SAD', `${px}/sad${multiplier}.png`),
|
||||
buildEmote('SALTY', `${px}/salty${multiplier}.png`),
|
||||
buildEmote('SCARY', `${px}/scary${multiplier}.png`),
|
||||
buildEmote('SLEEP', `${px}/Sleep${multiplier}.png`),
|
||||
buildEmote('SLIME_DOWN', `${px}/slime%20down${multiplier}.png`),
|
||||
buildEmote('SMELLY_SOCKS', `${px}/smelly%20socks${multiplier}.png`),
|
||||
buildEmote('SMILE_1', `${px}/smile${multiplier}.png`),
|
||||
buildEmote('SMILE_2', `${px}/smile%202${multiplier}.png`),
|
||||
buildEmote('SPACE_CHAD', `${px}/space%20chad${multiplier}.png`),
|
||||
buildEmote('SPACE_DOGE', `${px}/doge${multiplier}.png`),
|
||||
buildEmote('SPACE_GREEN_WOJAK', `${px}/space%20wojak${multiplier}-1.png`),
|
||||
buildEmote('SPACE_JULIAN', `${px}/Space%20Julian${multiplier}.png`),
|
||||
buildEmote('SPACE_RED_WOJAK', `${px}/space%20wojak${multiplier}.png`),
|
||||
buildEmote('SPACE_RESITAS', `${px}/resitas${multiplier}.png`),
|
||||
buildEmote('SPACE_TOM', `${px}/space%20Tom${multiplier}.png`),
|
||||
buildEmote('SPOCK', `${px}/SPOCK${multiplier}.png`),
|
||||
buildEmote('STAR', `${px}/Star${multiplier}.png`),
|
||||
buildEmote('SUNNY_DAY', `${px}/sunny%20day${multiplier}.png`),
|
||||
buildEmote('SUPRISED', `${px}/surprised${multiplier}.png`),
|
||||
buildEmote('SWEET', `${px}/sweet${multiplier}.png`),
|
||||
buildEmote('THINKING_1', `${px}/thinking${multiplier}-1.png`),
|
||||
buildEmote('THINKING_2', `${px}/thinking${multiplier}.png`),
|
||||
buildEmote('THUMB_DOWN', `${px}/thumb%20down${multiplier}.png`),
|
||||
buildEmote('THUMB_UP_1', `${px}/thumb%20up${multiplier}-1.png`),
|
||||
buildEmote('THUMB_UP_2', `${px}/thumb%20up${multiplier}.png`),
|
||||
buildEmote('TINFOIL_HAT', `${px}/tin%20hat${multiplier}.png`),
|
||||
buildEmote('TROLL_KING', `${px}/Troll%20king${multiplier}.png`),
|
||||
buildEmote('UFO', `${px}/ufo${multiplier}.png`),
|
||||
buildEmote('WAITING', `${px}/waiting${multiplier}.png`),
|
||||
buildEmote('WHAT', `${px}/what_${multiplier}.png`),
|
||||
buildEmote('WOODOO_DOLL', `${px}/woodo%20doll${multiplier}.png`),
|
||||
buildEmote('alien', `${px}/Alien${multiplier}.png`),
|
||||
buildEmote('angry_1', `${px}/angry${multiplier}.png`),
|
||||
buildEmote('angry_2', `${px}/angry%202${multiplier}.png`),
|
||||
buildEmote('angry_3', `${px}/angry%203${multiplier}.png`),
|
||||
buildEmote('angry_4', `${px}/angry%204${multiplier}.png`),
|
||||
buildEmote('blind', `${px}/blind${multiplier}.png`),
|
||||
buildEmote('block', `${px}/block${multiplier}.png`),
|
||||
buildEmote('bomb', `${px}/bomb${multiplier}.png`),
|
||||
buildEmote('brain_chip', `${px}/Brain%20chip${multiplier}.png`),
|
||||
buildEmote('confirm', `${px}/CONFIRM${multiplier}.png`),
|
||||
buildEmote('confused_1', `${px}/confused${multiplier}-1.png`),
|
||||
buildEmote('confused_2', `${px}/confused${multiplier}.png`),
|
||||
buildEmote('cooking_something_nice', `${px}/cooking%20something%20nice${multiplier}.png`),
|
||||
buildEmote('cry_1', `${px}/cry${multiplier}.png`),
|
||||
buildEmote('cry_2', `${px}/cry%202${multiplier}.png`),
|
||||
buildEmote('cry_3', `${px}/cry%203${multiplier}.png`),
|
||||
buildEmote('cry_4', `${px}/cry%204${multiplier}.png`),
|
||||
buildEmote('cry_5', `${px}/cry%205${multiplier}.png`),
|
||||
buildEmote('donut', `${px}/donut${multiplier}.png`),
|
||||
buildEmote('eggplant_with_condom', `${px}/eggplant%20with%20condom${multiplier}.png`),
|
||||
buildEmote('eggplant', `${px}/eggplant${multiplier}.png`),
|
||||
buildEmote('fire_up', `${px}/fire%20up${multiplier}.png`),
|
||||
buildEmote('flat_earth', `${px}/Flat%20earth${multiplier}.png`),
|
||||
buildEmote('flying_saucer', `${px}/Flying%20saucer${multiplier}.png`),
|
||||
buildEmote('heart_chopper', `${px}/heart%20chopper${multiplier}.png`),
|
||||
buildEmote('hyper_troll', `${px}/HyperTroll${multiplier}.png`),
|
||||
buildEmote('ice_cream', `${px}/ice%20cream${multiplier}.png`),
|
||||
buildEmote('idk', `${px}/IDK${multiplier}.png`),
|
||||
buildEmote('illuminati_1', `${px}/Illuminati${multiplier}-1.png`),
|
||||
buildEmote('illuminati_2', `${px}/Illuminati${multiplier}.png`),
|
||||
buildEmote('kiss_1', `${px}/kiss${multiplier}.png`),
|
||||
buildEmote('kiss_2', `${px}/kiss%202${multiplier}.png`),
|
||||
buildEmote('laser_gun', `${px}/laser%20gun${multiplier}.png`),
|
||||
buildEmote('laughing_1', `${px}/Laughing${multiplier}.png`),
|
||||
buildEmote('laughing_2', `${px}/Laughing 2${multiplier}.png`),
|
||||
buildEmote('lollipop', `${px}/Lollipop${multiplier}.png`),
|
||||
buildEmote('love_1', `${px}/Love${multiplier}.png`),
|
||||
buildEmote('love_2', `${px}/Love%202${multiplier}.png`),
|
||||
buildEmote('monster', `${px}/Monster${multiplier}.png`),
|
||||
buildEmote('mushroom', `${px}/mushroom${multiplier}.png`),
|
||||
buildEmote('nail_it', `${px}/Nail%20It${multiplier}.png`),
|
||||
buildEmote('no', `${px}/NO${multiplier}.png`),
|
||||
buildEmote('ouch', `${px}/ouch${multiplier}.png`),
|
||||
buildEmote('peace', `${px}/peace${multiplier}.png`),
|
||||
buildEmote('pizza', `${px}/pizza${multiplier}.png`),
|
||||
buildEmote('rabbit_hole', `${px}/rabbit%20hole${multiplier}.png`),
|
||||
buildEmote('rainbow_puke_1', `${px}/rainbow%20puke${multiplier}-1.png`),
|
||||
buildEmote('rainbow_puke_2', `${px}/rainbow%20puke${multiplier}.png`),
|
||||
buildEmote('rock', `${px}/ROCK${multiplier}.png`),
|
||||
buildEmote('sad', `${px}/sad${multiplier}.png`),
|
||||
buildEmote('salty', `${px}/salty${multiplier}.png`),
|
||||
buildEmote('scary', `${px}/scary${multiplier}.png`),
|
||||
buildEmote('sleep', `${px}/Sleep${multiplier}.png`),
|
||||
buildEmote('slime_down', `${px}/slime%20down${multiplier}.png`),
|
||||
buildEmote('smelly_socks', `${px}/smelly%20socks${multiplier}.png`),
|
||||
buildEmote('smile_1', `${px}/smile${multiplier}.png`),
|
||||
buildEmote('smile_2', `${px}/smile%202${multiplier}.png`),
|
||||
buildEmote('space_chad', `${px}/space%20chad${multiplier}.png`),
|
||||
buildEmote('space_doge', `${px}/doge${multiplier}.png`),
|
||||
buildEmote('space_green_wojak', `${px}/space%20wojak${multiplier}-1.png`),
|
||||
buildEmote('space_julian', `${px}/Space%20Julian${multiplier}.png`),
|
||||
buildEmote('space_red_wojak', `${px}/space%20wojak${multiplier}.png`),
|
||||
buildEmote('space_resitas', `${px}/resitas${multiplier}.png`),
|
||||
buildEmote('space_tom', `${px}/space%20Tom${multiplier}.png`),
|
||||
buildEmote('spock', `${px}/SPOCK${multiplier}.png`),
|
||||
buildEmote('star', `${px}/Star${multiplier}.png`),
|
||||
buildEmote('sunny_day', `${px}/sunny%20day${multiplier}.png`),
|
||||
buildEmote('surprised', `${px}/surprised${multiplier}.png`),
|
||||
buildEmote('sweet', `${px}/sweet${multiplier}.png`),
|
||||
buildEmote('thinking_1', `${px}/thinking${multiplier}-1.png`),
|
||||
buildEmote('thinking_2', `${px}/thinking${multiplier}.png`),
|
||||
buildEmote('thumb_down', `${px}/thumb%20down${multiplier}.png`),
|
||||
buildEmote('thumb_up_1', `${px}/thumb%20up${multiplier}-1.png`),
|
||||
buildEmote('thumb_up_2', `${px}/thumb%20up${multiplier}.png`),
|
||||
buildEmote('tinfoil_hat', `${px}/tin%20hat${multiplier}.png`),
|
||||
buildEmote('troll_king', `${px}/Troll%20king${multiplier}.png`),
|
||||
buildEmote('ufo', `${px}/ufo${multiplier}.png`),
|
||||
buildEmote('waiting', `${px}/waiting${multiplier}.png`),
|
||||
buildEmote('what', `${px}/what_${multiplier}.png`),
|
||||
buildEmote('woodoo_doll', `${px}/woodo%20doll${multiplier}.png`),
|
||||
];
|
||||
|
||||
export const EMOTES_24px = getEmotes('24%20px', '');
|
||||
|
|
Loading…
Reference in a new issue