diff --git a/apps/web/src/app/games/matching/components/EmojiPicker.tsx b/apps/web/src/app/games/matching/components/EmojiPicker.tsx index 7038c882..8b452084 100644 --- a/apps/web/src/app/games/matching/components/EmojiPicker.tsx +++ b/apps/web/src/app/games/matching/components/EmojiPicker.tsx @@ -93,6 +93,20 @@ export function EmojiPicker({ currentEmoji, onEmojiSelect, onClose, playerNumber const isSearching = searchFilter.trim().length > 0 const isCategoryFiltered = selectedCategory !== null && !isSearching + // Calculate which categories have emojis + const availableCategories = useMemo(() => { + const categoryCounts: Record = {} + PLAYER_EMOJIS.forEach(emoji => { + const data = emojiMap.get(emoji) + if (data && data.group !== undefined) { + categoryCounts[data.group] = (categoryCounts[data.group] || 0) + 1 + } + }) + return Object.keys(EMOJI_GROUPS) + .map(Number) + .filter(groupId => categoryCounts[groupId] > 0) + }, []) + const displayEmojis = useMemo(() => { // Start with all emojis let emojis = PLAYER_EMOJIS @@ -319,7 +333,9 @@ export function EmojiPicker({ currentEmoji, onEmojiSelect, onClose, playerNumber > ✨ All - {Object.entries(EMOJI_GROUPS).map(([groupId, group]) => ( + {availableCategories.map((groupId) => { + const group = EMOJI_GROUPS[groupId as keyof typeof EMOJI_GROUPS] + return ( - ))} + ) + })} )} @@ -559,55 +576,96 @@ export function EmojiPicker({ currentEmoji, onEmojiSelect, onClose, playerNumber - {/* Magnifying Glass Preview */} + {/* Magnifying Glass Preview - SUPER POWERED! */} {hoveredEmoji && (
-
- {hoveredEmoji} -
- {/* Arrow pointing down */} + {/* Outer glow ring */}
+ + {/* Main preview card */} +
+ {/* Sparkle effects */} +
+
+
+ + {hoveredEmoji} +
+ + {/* Arrow pointing down with glow */} +
)} - {/* Add magnifying animation */} + {/* Add magnifying animations */}