From f0e04e2569e26906623daedd0eadee173aeb0ddf Mon Sep 17 00:00:00 2001 From: Lemon Date: Fri, 6 Mar 2026 13:07:25 -0800 Subject: [PATCH] Convert emoji/GIF/stickers picker from popover to centered dialog The picker was positioned relative to the trigger button via a Popover, which felt awkward especially on smaller screens or inside other modals. Now renders as a centered Dialog with a backdrop for a more traditional modal experience. --- src/components/ComposeBox.tsx | 240 +++++++++++++++++----------------- 1 file changed, 119 insertions(+), 121 deletions(-) diff --git a/src/components/ComposeBox.tsx b/src/components/ComposeBox.tsx index 816a8699..f391a010 100644 --- a/src/components/ComposeBox.tsx +++ b/src/components/ComposeBox.tsx @@ -11,7 +11,7 @@ import { Skeleton } from '@/components/ui/skeleton'; import { Input } from '@/components/ui/input'; import { ScrollArea } from '@/components/ui/scroll-area'; import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'; -import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; +import { Dialog, DialogContent } from '@/components/ui/dialog'; import { EmojiPicker } from '@/components/EmojiPicker'; import { useCustomEmojis } from '@/hooks/useCustomEmojis'; import { useFeedSettings } from '@/hooks/useFeedSettings'; @@ -1178,132 +1178,130 @@ export function ComposeBox({ )} {/* Emoji / GIF picker */} - - - - + + + + + {!pickerOpen && Emoji / GIF} + + + e.preventDefault()} + > + {/* Tab bar */} +
+ + + {customEmojis.length > 0 && ( - - - {!pickerOpen && Emoji / GIF} - - - {/* Tab bar */} -
- - - {customEmojis.length > 0 && ( - - )} -
- {/* Picker content */} - {pickerTab === 'emoji' ? ( - { - if (selection.type === 'native') { - insertEmoji(selection.emoji); - } else { - insertEmoji(`:${selection.shortcode}:`); - } - }} - /> - ) : pickerTab === 'stickers' ? ( -
- {customEmojis.length === 0 ? ( -
- -

No sticker packs yet

-

Add emoji packs to your profile to use stickers

-
- ) : ( - -
- {customEmojis.map((emoji) => ( - - ))} -
-
- )} -
- ) : ( - { - setContent((prev) => (prev ? prev + '\n' + gif.url : gif.url)); - setPickerOpen(false); - expand(); - }} /> - )} -
- + )} +
+ {/* Picker content */} + {pickerTab === 'emoji' ? ( + { + if (selection.type === 'native') { + insertEmoji(selection.emoji); + } else { + insertEmoji(`:${selection.shortcode}:`); + } + }} + /> + ) : pickerTab === 'stickers' ? ( +
+ {customEmojis.length === 0 ? ( +
+ +

No sticker packs yet

+

Add emoji packs to your profile to use stickers

+
+ ) : ( + +
+ {customEmojis.map((emoji) => ( + + ))} +
+
+ )} +
+ ) : ( + { + setContent((prev) => (prev ? prev + '\n' + gif.url : gif.url)); + setPickerOpen(false); + expand(); + }} /> + )} +
+
{/* Content warning (NIP-36) */}