From 89bba0e2e3427d46601a72cd67c1d1fd9deab0ed Mon Sep 17 00:00:00 2001 From: ewwwwwwww Date: Wed, 29 Jun 2022 01:25:57 -0700 Subject: [PATCH] lint fixes --- .../components/emoji_picker_dropdown.tsx | 63 +++++++++---------- app/soapbox/features/emoji/emoji_picker.tsx | 6 +- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/app/soapbox/features/compose/components/emoji_picker_dropdown.tsx b/app/soapbox/features/compose/components/emoji_picker_dropdown.tsx index 5704f8f61d..31722a5335 100644 --- a/app/soapbox/features/compose/components/emoji_picker_dropdown.tsx +++ b/app/soapbox/features/compose/components/emoji_picker_dropdown.tsx @@ -1,18 +1,19 @@ import classNames from 'classnames'; -import React, { useRef, useEffect, useState } from 'react'; -import { usePopper } from 'react-popper'; -import { defineMessages, useIntl } from 'react-intl'; -import { createPortal } from 'react-dom'; import { supportsPassiveEvents } from 'detect-passive-events'; +import React, { useEffect, useState } from 'react'; +import { createPortal } from 'react-dom'; +import { defineMessages, useIntl } from 'react-intl'; +import { usePopper } from 'react-popper'; -import { IconButton, Toggle } from 'soapbox/components/ui'; -import { useSettings, useSystemTheme } from 'soapbox/hooks'; -import type { List } from 'immutable'; +import { IconButton } from 'soapbox/components/ui'; +import { useSettings } from 'soapbox/hooks'; import { buildCustomEmojis } from '../../emoji/emoji'; import { EmojiPicker as EmojiPickerAsync } from '../../ui/util/async-components'; // import EmojiPicker from '../../emoji/emoji_picker'; +import type { List } from 'immutable'; + let EmojiPicker: any; // load asynchronously const messages = defineMessages({ @@ -33,8 +34,8 @@ const messages = defineMessages({ }); interface IEmojiPickerDropdown { - custom_emojis: any, - frequentlyUsedEmojis: string[], + custom_emojis: List, + frequentlyUsedEmojis: string[], intl: any, onPickEmoji: (emoji: any) => void, onSkinTone: () => void, @@ -65,15 +66,11 @@ const EmojiPickerDropdown: React.FC = ({ custom_emojis, fr setVisible(!visible); }; - const handleHide = () => { - setVisible(false); - }; - const handleDocClick = (e: any) => { if (!containerElement?.contains(e.target) && !popperElement?.contains(e.target)) { setVisible(false); } - } + }; const handlePick = (emoji: any) => { if (!emoji.native) { @@ -82,7 +79,7 @@ const EmojiPickerDropdown: React.FC = ({ custom_emojis, fr setVisible(false); onPickEmoji(emoji); - } + }; const getI18n = () => { return { @@ -111,7 +108,7 @@ const EmojiPickerDropdown: React.FC = ({ custom_emojis, fr return function cleanup() { document.removeEventListener('click', handleDocClick); document.removeEventListener('touchend', handleDocClick); - } + }; }); useEffect(() => { @@ -133,21 +130,23 @@ const EmojiPickerDropdown: React.FC = ({ custom_emojis, fr if (loading) { Popup = () =>
; } else { - Popup = () =>
- -
+ Popup = () => ( +
+ +
+ ); } return ( @@ -179,7 +178,7 @@ const EmojiPickerDropdown: React.FC = ({ custom_emojis, fr > {visible && ()}
, - document.body + document.body, )} ); diff --git a/app/soapbox/features/emoji/emoji_picker.tsx b/app/soapbox/features/emoji/emoji_picker.tsx index 691af4a137..d76eec5060 100644 --- a/app/soapbox/features/emoji/emoji_picker.tsx +++ b/app/soapbox/features/emoji/emoji_picker.tsx @@ -1,4 +1,4 @@ -import data from '@emoji-mart/data/sets/14/twitter.json' +import data from '@emoji-mart/data/sets/14/twitter.json'; import { Picker as EmojiPicker, PickerProps } from 'emoji-mart'; import React, { useRef, useEffect } from 'react'; @@ -29,5 +29,5 @@ function Picker(props: PickerProps) { } export { - Picker -} + Picker, +};