diff --git a/apps/web/src/components/editor/media-panel/views/stickers.tsx b/apps/web/src/components/editor/media-panel/views/stickers.tsx index 937a968e..7d3e073e 100644 --- a/apps/web/src/components/editor/media-panel/views/stickers.tsx +++ b/apps/web/src/components/editor/media-panel/views/stickers.tsx @@ -80,25 +80,25 @@ export function StickersView() { @@ -111,16 +111,22 @@ function StickerGrid({ icons, onAdd, addingSticker, + capSize = false, }: { icons: string[]; onAdd: (iconName: string) => void; addingSticker: string | null; + capSize?: boolean; }) { return (
{icons.map((iconName) => ( @@ -129,6 +135,7 @@ function StickerGrid({ iconName={iconName} onAdd={onAdd} isAdding={addingSticker === iconName} + capSize={capSize} /> ))}
@@ -148,7 +155,7 @@ function CollectionGrid({ onSelectCollection: (prefix: string) => void; }) { return ( -
+
{collections.map((collection) => ( (null); @@ -363,7 +371,15 @@ function StickersContentView({ category }: { category: StickerCategory }) { setSelectedCollection(null); } }} - placeholder="Search icons..." + placeholder={ + category === "all" + ? "Search all stickers" + : category === "general" + ? "Search icons" + : category === "brands" + ? "Search brands" + : "Search Emojis" + } value={localSearchQuery} onChange={setLocalSearchQuery} /> @@ -401,6 +417,7 @@ function StickersContentView({ category }: { category: StickerCategory }) { icons={recentStickers.slice(0, 12)} onAdd={handleAddSticker} addingSticker={addingSticker} + capSize />
)} @@ -442,12 +459,32 @@ function StickersContentView({ category }: { category: StickerCategory }) { icons={iconsToDisplay} onAdd={handleAddSticker} addingSticker={addingSticker} + capSize /> ) : searchQuery ? ( - +
+ + {category !== "all" && ( + + )} +
) : null}
)} @@ -525,9 +562,10 @@ interface StickerItemProps { iconName: string; onAdd: (iconName: string) => void; isAdding?: boolean; + capSize?: boolean; } -function StickerItem({ iconName, onAdd, isAdding }: StickerItemProps) { +function StickerItem({ iconName, onAdd, isAdding, capSize = false }: StickerItemProps) { const [imageError, setImageError] = useState(false); const [hostIndex, setHostIndex] = useState(0); @@ -561,6 +599,11 @@ function StickerItem({ iconName, onAdd, isAdding }: StickerItemProps) { width={64} height={64} className="w-full h-full object-contain" + style={ + capSize + ? { maxWidth: "var(--sticker-max, 160px)", maxHeight: "var(--sticker-max, 160px)" } + : undefined + } onError={() => { const next = hostIndex + 1; if (next < ICONIFY_HOSTS.length) { @@ -598,6 +641,7 @@ function StickerItem({ iconName, onAdd, isAdding }: StickerItemProps) { rounded={true} variant="card" className="" + containerClassName="w-full" isDraggable={false} /> {isAdding && ( diff --git a/apps/web/src/components/ui/draggable-item.tsx b/apps/web/src/components/ui/draggable-item.tsx index 92aa677b..f6d5c696 100644 --- a/apps/web/src/components/ui/draggable-item.tsx +++ b/apps/web/src/components/ui/draggable-item.tsx @@ -21,6 +21,7 @@ export interface DraggableMediaItemProps { onAddToTimeline?: (currentTime: number) => void; aspectRatio?: number; className?: string; + containerClassName?: string; showPlusOnDrag?: boolean; showLabel?: boolean; rounded?: boolean; @@ -36,6 +37,7 @@ export function DraggableMediaItem({ onAddToTimeline, aspectRatio = 16 / 9, className = "", + containerClassName, showPlusOnDrag = true, showLabel = true, rounded = true, @@ -95,7 +97,10 @@ export function DraggableMediaItem({ return ( <> {variant === "card" ? ( -
+