From 037b81c49e7231cfe47449e3de3488fe24b71df0 Mon Sep 17 00:00:00 2001 From: enes Date: Thu, 26 Dec 2024 16:39:09 +0100 Subject: [PATCH] fix(games): add no games found in search Closes #141 --- src/pages/search.tsx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pages/search.tsx b/src/pages/search.tsx index 683696f..68ff768 100644 --- a/src/pages/search.tsx +++ b/src/pages/search.tsx @@ -39,6 +39,7 @@ import { scrollIntoView } from 'utils' import { useCuratedSet } from 'hooks/useCuratedSet' +import dedup from 'utils/nostr' enum SearchKindEnum { Mods = 'Mods', @@ -508,6 +509,11 @@ const GamesResult = ({ searchTerm }: GamesResultProps) => { return ( <> + {searchTerm !== '' && filteredGames.length === 0 && ( +
+ Game not found. Send us a message where you can reach us to add it +
+ )}
{filteredGames @@ -521,20 +527,14 @@ const GamesResult = ({ searchTerm }: GamesResultProps) => { ))}
- + {searchTerm !== '' && filteredGames.length > MAX_GAMES_PER_PAGE && ( + + )} ) } -function dedup(event1: NDKEvent, event2: NDKEvent) { - // return the newest of the two - if (event1.created_at! > event2.created_at!) { - return event1 - } - - return event2 -}