Sticker Creator
This commit is contained in:
parent
2df1ba6e61
commit
11d47a8eb9
123 changed files with 11287 additions and 1714 deletions
|
@ -6,7 +6,7 @@ export type OwnProps = {
|
|||
inline?: boolean;
|
||||
shortName: string;
|
||||
skinTone?: SkinToneKey | number;
|
||||
size?: 16 | 18 | 20 | 28 | 32 | 64 | 66;
|
||||
size?: 16 | 18 | 20 | 24 | 28 | 32 | 64 | 66;
|
||||
children?: React.ReactNode;
|
||||
};
|
||||
|
||||
|
|
|
@ -24,10 +24,10 @@ export type EmojiPickDataType = { skinTone?: number; shortName: string };
|
|||
export type OwnProps = {
|
||||
readonly i18n: LocalizerType;
|
||||
readonly onPickEmoji: (o: EmojiPickDataType) => unknown;
|
||||
readonly doSend: () => unknown;
|
||||
readonly doSend?: () => unknown;
|
||||
readonly skinTone: number;
|
||||
readonly onSetSkinTone: (tone: number) => unknown;
|
||||
readonly recentEmojis: Array<string>;
|
||||
readonly recentEmojis?: Array<string>;
|
||||
readonly onClose: () => unknown;
|
||||
};
|
||||
|
||||
|
@ -63,7 +63,7 @@ export const EmojiPicker = React.memo(
|
|||
onPickEmoji,
|
||||
skinTone = 0,
|
||||
onSetSkinTone,
|
||||
recentEmojis,
|
||||
recentEmojis = [],
|
||||
style,
|
||||
onClose,
|
||||
}: Props,
|
||||
|
@ -126,7 +126,9 @@ export const EmojiPicker = React.memo(
|
|||
if ('key' in e) {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
doSend();
|
||||
if (doSend) {
|
||||
doSend();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const { shortName } = e.currentTarget.dataset;
|
||||
|
|
|
@ -4,6 +4,7 @@ import emojiRegex from 'emoji-regex';
|
|||
import {
|
||||
compact,
|
||||
flatMap,
|
||||
get,
|
||||
groupBy,
|
||||
isNumber,
|
||||
keyBy,
|
||||
|
@ -71,8 +72,16 @@ const data = (untypedData as Array<EmojiData>).filter(
|
|||
emoji => emoji.has_img_apple
|
||||
);
|
||||
|
||||
// @ts-ignore
|
||||
const ROOT_PATH = get(
|
||||
// tslint:disable-next-line no-typeof-undefined
|
||||
typeof window !== 'undefined' ? window : null,
|
||||
'ROOT_PATH',
|
||||
''
|
||||
);
|
||||
|
||||
const makeImagePath = (src: string) => {
|
||||
return `node_modules/emoji-datasource-apple/img/apple/64/${src}`;
|
||||
return `${ROOT_PATH}node_modules/emoji-datasource-apple/img/apple/64/${src}`;
|
||||
};
|
||||
|
||||
const imageQueue = new PQueue({ concurrency: 10 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue