From dda00e99046b758d3e3ab5d016f3d8d312d0d0b3 Mon Sep 17 00:00:00 2001 From: meet Date: Mon, 7 Oct 2024 19:14:27 +0530 Subject: [PATCH] Make the Search and Sort features responsive --- frontend/src/pages/Posts.tsx | 86 +++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 41 deletions(-) diff --git a/frontend/src/pages/Posts.tsx b/frontend/src/pages/Posts.tsx index 443c914..ef98dd9 100644 --- a/frontend/src/pages/Posts.tsx +++ b/frontend/src/pages/Posts.tsx @@ -210,54 +210,58 @@ const Posts = () => { )} -
-
- Sort by: - handleSortChange(e.target.value)} + className="p-2 rounded-md text-[#000435] bg-white dark:text-white dark:bg-[#000435] border border-sky-400 focus:outline-none focus:ring-2 focus:ring-blue-500 mr-4" + > + -
- setSearchQuery(e.target.value)} - placeholder="🔍 Search anything" - className="p-2 w-full max-w-xs rounded-md text-[#000435] bg-white dark:text-white dark:bg-[#000435] border border-sky-400 focus:outline-none focus:ring-2 focus:ring-blue-500" - onKeyDown={(event) => { - if (event.key == "Enter") { - handleSearch() - } - }} - /> - +
+ + {showSuggestions && suggestions.length > 0 && ( + + )} + {filteredPosts.length === 0 ? (
No Posts