From 45657c7a2a9aec4fe96ad9b59822550f37375d2b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 13 Feb 2023 13:16:14 -0600 Subject: [PATCH] EmojiSelector: pass offset as a prop --- app/soapbox/components/ui/emoji-selector/emoji-selector.tsx | 5 ++++- .../chat-message-reaction-wrapper.tsx | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/soapbox/components/ui/emoji-selector/emoji-selector.tsx b/app/soapbox/components/ui/emoji-selector/emoji-selector.tsx index 57d06b251e..9bbce36f72 100644 --- a/app/soapbox/components/ui/emoji-selector/emoji-selector.tsx +++ b/app/soapbox/components/ui/emoji-selector/emoji-selector.tsx @@ -43,6 +43,8 @@ interface IEmojiSelector { placement?: Placement /** Whether the selector should be visible. */ visible?: boolean + /** X/Y offset of the floating picker. */ + offset?: [number, number] /** Whether to allow any emoji to be chosen. */ all?: boolean } @@ -54,6 +56,7 @@ const EmojiSelector: React.FC = ({ onReact, placement = 'top', visible = false, + offset = [-10, 0], all = true, }): JSX.Element => { const soapboxConfig = useSoapboxConfig(); @@ -80,7 +83,7 @@ const EmojiSelector: React.FC = ({ { name: 'offset', options: { - offset: [-10, 12], + offset, }, }, ], 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 d9403af4ae..10ca56b4f9 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 @@ -41,6 +41,7 @@ function ChatMessageReactionWrapper(props: IChatMessageReactionWrapper) { referenceElement={referenceElement} onReact={handleSelect} onClose={() => setIsOpen(false)} + offset={[-10, 12]} all={false} />