From 1dedb1117ce6653828b75c8abe806daf4917d1a3 Mon Sep 17 00:00:00 2001 From: kimjaehyeon0101 <47347352-kimjaehyeon0101@users.noreply.replit.com> Date: Mon, 29 Sep 2025 21:36:44 +0000 Subject: [PATCH] Add a close button and adjust spacing in the search pop-up window Updates SearchModal component: adds a close (X) icon next to the search bar, reduces padding and margin between elements within the modal for a more compact layout, and imports the X icon from lucide-react. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 069d4324-6c40-4355-955e-c714a50de1ea Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/069d4324-6c40-4355-955e-c714a50de1ea/bLfICpO --- client/src/components/SearchModal.tsx | 66 +++++++++++++++------------ 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/client/src/components/SearchModal.tsx b/client/src/components/SearchModal.tsx index f6ee415..69f9fa7 100644 --- a/client/src/components/SearchModal.tsx +++ b/client/src/components/SearchModal.tsx @@ -3,7 +3,7 @@ import { useQuery } from "@tanstack/react-query"; import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Badge } from "@/components/ui/badge"; -import { Search } from "lucide-react"; +import { Search, X } from "lucide-react"; import { Link } from "wouter"; import type { MediaOutlet, Article } from "@shared/schema"; @@ -59,10 +59,10 @@ export default function SearchModal({ isOpen, onClose }: SearchModalProps) { return ( - + Search Articles and Media Outlets {/* Search Header */} -
+
+
{/* Search Results */} -
+
{!debouncedQuery.trim() ? ( /* Empty State */ -
-

Start typing to search articles and outlets

+
+

Start typing to search articles and outlets

) : isLoading ? ( /* Loading State */ -
+
{Array.from({ length: 5 }).map((_, i) => (
-
+
))}
) : totalResults === 0 ? ( /* No Results */ -
-

No results found for "{debouncedQuery}"

-

Try a different search term

+
+

No results found for "{debouncedQuery}"

+

Try a different search term

) : ( /* Search Results */ <> -
+
{totalResults} results found
{/* Outlets Section */} {searchResults && searchResults.outlets.length > 0 && ( -
-

+
+

Outlets ({searchResults.outlets.length})

-
+
{searchResults.outlets.map((outlet) => ( -
-
+
+
{outlet.imageUrl ? ( ) : ( - + {outlet.name.charAt(0)} )}
-
-

+
+

{outlet.name}

- + {outlet.category}
-

+

{outlet.description || "Media Outlet"}

@@ -158,10 +166,10 @@ export default function SearchModal({ isOpen, onClose }: SearchModalProps) { {/* Articles Section */} {searchResults && searchResults.articles.length > 0 && (
-

+

Articles ({searchResults.articles.length})

-
+
{searchResults.articles.map((article) => ( -
+
{article.imageUrl && ( -
+
{article.title} )}
-

+

{article.title}

-

+

{article.excerpt || ""}

{article.publishedAt && ( -

+

{new Date(article.publishedAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric',