From a914efacfdfb0afeed40cd7e5184c8a603e62d72 Mon Sep 17 00:00:00 2001 From: Chad Curtis Date: Wed, 4 Mar 2026 03:45:01 -0600 Subject: [PATCH] Add Stickers tab to emoji/GIF picker using custom emoji packs --- src/components/ComposeBox.tsx | 151 ++++++++++++++++++++++------------ 1 file changed, 99 insertions(+), 52 deletions(-) diff --git a/src/components/ComposeBox.tsx b/src/components/ComposeBox.tsx index d646ca87..4f7ba58a 100644 --- a/src/components/ComposeBox.tsx +++ b/src/components/ComposeBox.tsx @@ -1,6 +1,6 @@ import { useState, useRef, useCallback, useMemo, useEffect } from 'react'; import { Link } from 'react-router-dom'; -import { Paperclip, Smile, AlertTriangle, X, Loader2, Mic, Square } from 'lucide-react'; +import { Paperclip, Smile, AlertTriangle, X, Loader2, Mic, Square, Sticker } from 'lucide-react'; import { nip19 } from 'nostr-tools'; import { encode as blurhashEncode } from 'blurhash'; import type { NostrEvent } from '@nostrify/nostrify'; @@ -175,7 +175,7 @@ export function ComposeBox({ const [cwEnabled, setCwEnabled] = useState(false); const [cwText, setCwText] = useState(''); const [pickerOpen, setPickerOpen] = useState(false); - const [pickerTab, setPickerTab] = useState<'emoji' | 'gif'>('emoji'); + const [pickerTab, setPickerTab] = useState<'emoji' | 'gif' | 'stickers'>('emoji'); const [internalPreviewMode, setInternalPreviewMode] = useState(false); const [removedEmbeds, setRemovedEmbeds] = useState>(new Set()); const [_uploadedFileTags, setUploadedFileTags] = useState([]); @@ -1202,56 +1202,103 @@ export function ComposeBox({ className="w-auto p-0 border-border" > {/* Tab bar */} -
- - -
- {/* Picker content */} - {pickerTab === 'emoji' ? ( - { - if (selection.type === 'native') { - insertEmoji(selection.emoji); - } else { - insertEmoji(`:${selection.shortcode}:`); - } - }} - /> - ) : ( - { - setContent((prev) => (prev ? prev + '\n' + gif.url : gif.url)); - setPickerOpen(false); - expand(); - }} /> - )} +
+ + + {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(); + }} /> + )}