From 71d2f1fdaeee19036f45ef7bf393882b54843446 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Sat, 30 Aug 2025 22:57:27 +0000 Subject: [PATCH] Update navigation logic to use Wouter for smoother page transitions Replaced direct window.location.href assignments with setLocation from Wouter in FolxStadlPage.tsx to improve client-side routing and prevent full page reloads. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 344ec1e0-1186-4058-bbff-2e9619a7b1e0 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/344ec1e0-1186-4058-bbff-2e9619a7b1e0/FgaI1Sc --- client/src/pages/FolxStadlPage.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/pages/FolxStadlPage.tsx b/client/src/pages/FolxStadlPage.tsx index 0f5222e..9aac9e3 100644 --- a/client/src/pages/FolxStadlPage.tsx +++ b/client/src/pages/FolxStadlPage.tsx @@ -1,5 +1,5 @@ import { useQuery } from '@tanstack/react-query'; -import { Link } from 'wouter'; +import { Link, useLocation } from 'wouter'; import { ArrowLeft, ChevronLeft, ChevronRight, Menu, X } from 'lucide-react'; import VideoCard from '@/components/video-card'; import BunnyVideoModal from '@/components/bunny-video-modal'; @@ -16,6 +16,7 @@ export default function FolxStadlPage() { const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); const [searchQuery, setSearchQuery] = useState(""); const [viewMode, setViewMode] = useState<"grid" | "list">("grid"); + const [, setLocation] = useLocation(); const itemsPerPage = 10; const { data, isLoading } = useQuery<{videos: Video[], total: number}>({ @@ -38,7 +39,7 @@ export default function FolxStadlPage() { const handleVideoClick = (video: Video) => { // Navigate to individual video page instead of modal - window.location.href = `/video/${video.id}`; + setLocation(`/video/${video.id}`); }; const handleCloseModal = () => { @@ -90,7 +91,7 @@ export default function FolxStadlPage() { value={searchQuery} onChange={(e) => { setSearchQuery(e.target.value); - if (e.target.value) window.location.href = `/?search=${encodeURIComponent(e.target.value)}`; + if (e.target.value) setLocation(`/?search=${encodeURIComponent(e.target.value)}`); }} className="bg-white border border-gray-300 rounded-lg px-4 py-2 pl-10 text-sm text-gray-900 placeholder-gray-500 focus:outline-none focus:border-bunny-blue transition-colors w-64" />