From 0aeeeb1dc4899cc3f4c34a5799d8af0c41aa8b17 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 14 Feb 2023 11:20:25 -0600 Subject: [PATCH] Performance: hide EmojiSelector until portaled --- .../components/status-reaction-wrapper.tsx | 18 ++++++++------- .../chat-message-reaction-wrapper.tsx | 22 ++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/soapbox/components/status-reaction-wrapper.tsx b/app/soapbox/components/status-reaction-wrapper.tsx index 95323f24d3..47677e1572 100644 --- a/app/soapbox/components/status-reaction-wrapper.tsx +++ b/app/soapbox/components/status-reaction-wrapper.tsx @@ -105,14 +105,16 @@ const StatusReactionWrapper: React.FC = ({ statusId, chi ref: setReferenceElement, })} - - - + {visible && ( + + + + )} ); }; diff --git a/app/soapbox/features/chats/components/chat-message-reaction-wrapper/chat-message-reaction-wrapper.tsx b/app/soapbox/features/chats/components/chat-message-reaction-wrapper/chat-message-reaction-wrapper.tsx index ccfb16d815..03cbf23a7b 100644 --- a/app/soapbox/features/chats/components/chat-message-reaction-wrapper/chat-message-reaction-wrapper.tsx +++ b/app/soapbox/features/chats/components/chat-message-reaction-wrapper/chat-message-reaction-wrapper.tsx @@ -37,16 +37,18 @@ function ChatMessageReactionWrapper(props: IChatMessageReactionWrapper) { onClick: onToggleVisibility, })} - - setIsOpen(false)} - offset={[-10, 12]} - all={false} - /> - + {isOpen && ( + + setIsOpen(false)} + offset={[-10, 12]} + all={false} + /> + + )} ); }