-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28589 from software-mansion-labs/ts-migration/emo…
…ji-utils-lib
- Loading branch information
Showing
8 changed files
with
242 additions
and
266 deletions.
There are no files selected for viewing
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 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 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 file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import emojis from './common'; | ||
import enEmojis from './en'; | ||
import esEmojis from './es'; | ||
import {Emoji} from './types'; | ||
|
||
type EmojiTable = Record<string, Emoji>; | ||
|
||
const emojiNameTable = emojis.reduce<EmojiTable>((prev, cur) => { | ||
const newValue = prev; | ||
if (!('header' in cur) && cur.name) { | ||
newValue[cur.name] = cur; | ||
} | ||
return newValue; | ||
}, {}); | ||
|
||
const emojiCodeTableWithSkinTones = emojis.reduce<EmojiTable>((prev, cur) => { | ||
const newValue = prev; | ||
if (!('header' in cur)) { | ||
newValue[cur.code] = cur; | ||
} | ||
if ('types' in cur && cur.types) { | ||
cur.types.forEach((type) => { | ||
newValue[type] = cur; | ||
}); | ||
} | ||
return newValue; | ||
}, {}); | ||
|
||
const localeEmojis = { | ||
en: enEmojis, | ||
es: esEmojis, | ||
} as const; | ||
|
||
export {emojiNameTable, emojiCodeTableWithSkinTones, localeEmojis}; | ||
export {skinTones, categoryFrequentlyUsed, default} from './common'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {SvgProps} from 'react-native-svg'; | ||
|
||
type Emoji = { | ||
code: string; | ||
name: string; | ||
types?: string[]; | ||
}; | ||
|
||
type HeaderEmoji = { | ||
header: true; | ||
icon: React.FC<SvgProps>; | ||
code: string; | ||
}; | ||
|
||
type PickerEmojis = Array<Emoji | HeaderEmoji>; | ||
|
||
type EmojisList = Record<string, {keywords: string[]; name?: string}>; | ||
|
||
export type {Emoji, HeaderEmoji, EmojisList, PickerEmojis}; |
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
Oops, something went wrong.