From 9aef41eab184d483b0b2600e899086f447213c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 28 Feb 2023 19:13:34 +0100 Subject: [PATCH] Cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../features/emoji/components/emoji-picker-dropdown.tsx | 4 ++++ .../emoji/containers/emoji-picker-dropdown-container.tsx | 6 +++--- app/soapbox/locales/en.json | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/soapbox/features/emoji/components/emoji-picker-dropdown.tsx b/app/soapbox/features/emoji/components/emoji-picker-dropdown.tsx index 7f622835c8..93100a39c5 100644 --- a/app/soapbox/features/emoji/components/emoji-picker-dropdown.tsx +++ b/app/soapbox/features/emoji/components/emoji-picker-dropdown.tsx @@ -226,6 +226,10 @@ const EmojiPickerDropdown: React.FC = ({ } }, [visible]); + useEffect(() => () => { + document.body.style.overflow = ''; + }, []); + return ( visible ? ( diff --git a/app/soapbox/features/emoji/containers/emoji-picker-dropdown-container.tsx b/app/soapbox/features/emoji/containers/emoji-picker-dropdown-container.tsx index f9b7150c46..c097e60569 100644 --- a/app/soapbox/features/emoji/containers/emoji-picker-dropdown-container.tsx +++ b/app/soapbox/features/emoji/containers/emoji-picker-dropdown-container.tsx @@ -16,7 +16,7 @@ export const messages = defineMessages({ emoji: { id: 'emoji_button.label', defaultMessage: 'Insert emoji' }, }); -const EmojiPickerDropdownWrapper = ( +const EmojiPickerDropdownContainer = ( props: Pick, ) => { const intl = useIntl(); @@ -53,7 +53,7 @@ const EmojiPickerDropdownWrapper = ( document.addEventListener('click', handleDocClick, false); document.addEventListener('touchend', handleDocClick, listenerOptions); - return function cleanup() { + return () => { document.removeEventListener('click', handleDocClick, false); // @ts-ignore document.removeEventListener('touchend', handleDocClick, listenerOptions); @@ -93,4 +93,4 @@ const EmojiPickerDropdownWrapper = ( }; -export default EmojiPickerDropdownWrapper; +export default EmojiPickerDropdownContainer; diff --git a/app/soapbox/locales/en.json b/app/soapbox/locales/en.json index ddbc0ae9ed..227e774040 100644 --- a/app/soapbox/locales/en.json +++ b/app/soapbox/locales/en.json @@ -631,6 +631,9 @@ "emoji_button.oh_no": "Oh no!", "emoji_button.people": "People", "emoji_button.pick": "Pick an emoji…", + "emoji_button.recent": "Frequently used", + "emoji_button.search": "Search…", + "emoji_button.search_results": "Search results", "emoji_button.skins_1": "Default", "emoji_button.skins_2": "Light", "emoji_button.skins_3": "Medium-Light", @@ -638,9 +641,6 @@ "emoji_button.skins_5": "Medium-Dark", "emoji_button.skins_6": "Dark", "emoji_button.skins_choose": "Choose default skin tone", - "emoji_button.recent": "Frequently used", - "emoji_button.search": "Search…", - "emoji_button.search_results": "Search results", "emoji_button.symbols": "Symbols", "emoji_button.travel": "Travel & Places", "empty_column.account_blocked": "You are blocked by @{accountUsername}.",