Fun picker: Emoji skin tones picker and recent gifs

This commit is contained in:
Jamie Kyle
2025-04-10 12:32:36 -07:00
committed by GitHub
parent b22aaaec7e
commit 8301e69e05
33 changed files with 834 additions and 100 deletions

View File

@@ -3,6 +3,7 @@
import { useCallback } from 'react';
import type { EmojiParentKey, EmojiVariantKey } from './data/emojis';
import {
getEmojiParentByKey,
getEmojiParentKeyByVariantKey,
getEmojiVariantKeyByValue,
isEmojiVariantValue,
@@ -39,11 +40,12 @@ export function useFunEmojiLocalizer(): FunEmojiLocalizer {
variantKey => {
const parentKey = getEmojiParentKeyByVariantKey(variantKey);
const localeShortName = emojiLocalizerIndex.get(parentKey);
strictAssert(
localeShortName,
`useFunEmojiLocalizer: Missing translation for ${variantKey}`
);
return localeShortName;
if (localeShortName != null) {
return localeShortName;
}
// Fallback to english short name
const parent = getEmojiParentByKey(parentKey);
return parent.englishShortNameDefault;
},
[emojiLocalizerIndex]
);