From 5364de90a4ba74aa0bf47793efa6d4e7fd81460b Mon Sep 17 00:00:00 2001 From: Chris Svenningsen Date: Mon, 14 Sep 2020 15:14:03 -0700 Subject: [PATCH] migrate components stickers to eslint --- .eslintignore | 2 - _locales/en/messages.json | 20 ++ .../stickers/StickerButton.stories.tsx | 4 - ts/components/stickers/StickerButton.tsx | 11 +- .../stickers/StickerManager.stories.tsx | 4 - ts/components/stickers/StickerManager.tsx | 14 +- .../stickers/StickerManagerPackRow.tsx | 9 +- .../stickers/StickerPackInstallButton.tsx | 2 + .../stickers/StickerPicker.stories.tsx | 4 - ts/components/stickers/StickerPicker.tsx | 23 +- .../stickers/StickerPreviewModal.stories.tsx | 12 +- .../stickers/StickerPreviewModal.tsx | 318 +++++++++--------- ts/components/stickers/lib.ts | 2 +- ts/util/lint/exceptions.json | 2 +- tslint.json | 1 + 15 files changed, 225 insertions(+), 203 deletions(-) diff --git a/.eslintignore b/.eslintignore index 858e994757..f489510d02 100644 --- a/.eslintignore +++ b/.eslintignore @@ -31,8 +31,6 @@ webpack.config.ts # Temporarily ignored during TSLint transition # JIRA: DESKTOP-304 -ts/*.ts -ts/components/stickers/** ts/shims/** ts/sql/** ts/storybook/** diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 1ea8bddc6a..68b1b601de 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1892,6 +1892,26 @@ "message": "Why use words when you can use stickers?", "description": "Shown as the body on a tooltip when the user upgrades to a version of Signal supporting stickers." }, + "stickers--StickerPicker--Open": { + "message": "Open the sticker picker", + "description": "Label for the open button for the sticker picker" + }, + "stickers--StickerPicker--AddPack": { + "message": "Add a sticker pack", + "description": "Label for the add pack button in the sticker picker" + }, + "stickers--StickerPicker--NextPage": { + "message": "Next Page", + "description": "Label for the next page button in the sticker picker" + }, + "stickers--StickerPicker--PrevPage": { + "message": "Previous Page", + "description": "Label for the previous page button in the sticker picker" + }, + "stickers--StickerPicker--Recents": { + "message": "Recent Sticker", + "description": "Label for the recent stickers button in the sticker picker" + }, "stickers--StickerPicker--DownloadError": { "message": "Some stickers could not be downloaded.", "description": "Shown in the sticker picker when one or more stickers could not be downloaded." diff --git a/ts/components/stickers/StickerButton.stories.tsx b/ts/components/stickers/StickerButton.stories.tsx index 81bba8ab2c..55db8b5fc7 100644 --- a/ts/components/stickers/StickerButton.stories.tsx +++ b/ts/components/stickers/StickerButton.stories.tsx @@ -3,12 +3,8 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { boolean } from '@storybook/addon-knobs'; -// @ts-ignore import { setup as setupI18n } from '../../../js/modules/i18n'; - -// @ts-ignore import enMessages from '../../../_locales/en/messages.json'; - import { Props, StickerButton } from './StickerButton'; import { createPack, diff --git a/ts/components/stickers/StickerButton.tsx b/ts/components/stickers/StickerButton.tsx index 578b679abc..3ff3e31d1d 100644 --- a/ts/components/stickers/StickerButton.tsx +++ b/ts/components/stickers/StickerButton.tsx @@ -29,7 +29,6 @@ export type OwnProps = { export type Props = OwnProps; export const StickerButton = React.memo( - // tslint:disable-next-line max-func-body-length ({ i18n, clearInstalledStickerPack, @@ -67,8 +66,9 @@ export const StickerButton = React.memo( } }, [ clearInstalledStickerPack, - onClickAddPack, + clearShowIntroduction, installedPacks, + onClickAddPack, popperRoot, setOpen, ]); @@ -161,7 +161,6 @@ export const StickerButton = React.memo( // Clear the installed pack after one minute React.useEffect(() => { if (installedPack) { - // tslint:disable-next-line:no-string-based-set-timeout const timerId = setTimeout(clearInstalledStickerPack, 10 * 1000); return () => { @@ -188,12 +187,14 @@ export const StickerButton = React.memo( {({ ref }) => (