Fix sticker creator in our new typescriptified world

This commit is contained in:
Scott Nonnenberg 2022-06-13 18:48:07 -07:00 committed by GitHub
parent f2af71f8b5
commit 68f27c1c7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 381 additions and 311 deletions

View file

@ -34,7 +34,7 @@ export type OwnProps = {
readonly onPickEmoji: (o: EmojiPickDataType) => unknown;
readonly doSend?: () => unknown;
readonly skinTone?: number;
readonly onSetSkinTone: (tone: number) => unknown;
readonly onSetSkinTone?: (tone: number) => unknown;
readonly recentEmojis?: Array<string>;
readonly onClickSettings?: () => unknown;
readonly onClose?: () => unknown;
@ -406,26 +406,28 @@ export const EmojiPicker = React.memo(
type="button"
/>
)}
<div className="module-emoji-picker__footer__skin-tones">
{[0, 1, 2, 3, 4, 5].map(tone => (
<button
type="button"
key={tone}
data-tone={tone}
onClick={handlePickTone}
title={i18n('EmojiPicker--skin-tone', [`${tone}`])}
className={classNames(
'module-emoji-picker__button',
'module-emoji-picker__button--footer',
selectedTone === tone
? 'module-emoji-picker__button--selected'
: null
)}
>
<Emoji shortName="hand" skinTone={tone} size={20} />
</button>
))}
</div>
{onSetSkinTone ? (
<div className="module-emoji-picker__footer__skin-tones">
{[0, 1, 2, 3, 4, 5].map(tone => (
<button
type="button"
key={tone}
data-tone={tone}
onClick={handlePickTone}
title={i18n('EmojiPicker--skin-tone', [`${tone}`])}
className={classNames(
'module-emoji-picker__button',
'module-emoji-picker__button--footer',
selectedTone === tone
? 'module-emoji-picker__button--selected'
: null
)}
>
<Emoji shortName="hand" skinTone={tone} size={20} />
</button>
))}
</div>
) : null}
{Boolean(onClickSettings) && (
<div className="module-emoji-picker__footer__settings-spacer" />
)}

View file

@ -913,8 +913,7 @@
"path": "node_modules/agent-base/node_modules/debug/src/common.js",
"line": "\tcreateDebug.enable(createDebug.load());",
"reasonCategory": "falseMatch|testCode|exampleCode|otherUtilityCode|regexMatchedSafeCode|notExercisedByOurApp|ruleNeeded|usageTrusted",
"updated": "2022-02-11T21:58:24.827Z",
"reasonDetail": "<optional>"
"updated": "2022-02-11T21:58:24.827Z"
},
{
"rule": "jQuery-load(",
@ -8273,6 +8272,13 @@
"reasonCategory": "falseMatch",
"updated": "2018-09-19T21:59:32.770Z"
},
{
"rule": "React-useRef",
"path": "sticker-creator/components/StickerFrame.js",
"line": " const timerRef = React.useRef();",
"reasonCategory": "falseMatch",
"updated": "2022-06-14T01:19:45.446Z"
},
{
"rule": "React-useRef",
"path": "sticker-creator/components/StickerFrame.tsx",
@ -8280,6 +8286,13 @@
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "jQuery-$(",
"path": "sticker-creator/util/i18n.js",
"line": " const FIND_REPLACEMENTS = /\\$([^$]+)\\$/g;",
"reasonCategory": "falseMatch",
"updated": "2022-06-14T01:19:45.446Z"
},
{
"rule": "jQuery-$(",
"path": "sticker-creator/util/i18n.tsx",

View file

@ -129,3 +129,4 @@ export const SignalContext: SignalContextType = {
};
window.SignalContext = SignalContext;
window.i18n = SignalContext.i18n;