Improve search functionality and navigation on the blog
Update search endpoint to use Bunny API's search parameter for efficiency, refactor client-side search query handling to use window.location.search for better query parameter retrieval, and update header navigation to use window.location.href for consistent routing. Also, update gallery image URLs in gallery-data.json. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: bdfa6652-3a31-4f32-a642-d62bd1746159 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/jdAEdU5 Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -29,10 +29,11 @@ export default function Header() {
|
||||
const handleSearch = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (searchQuery.trim().length >= 2) {
|
||||
navigate(`/search?q=${encodeURIComponent(searchQuery.trim())}`);
|
||||
const url = `/search?q=${encodeURIComponent(searchQuery.trim())}`;
|
||||
setSearchOpen(false);
|
||||
setSearchQuery("");
|
||||
setMobileOpen(false);
|
||||
window.location.href = url;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user