From a394123d1da3aa1a79db6c2c2515dae804de18e4 Mon Sep 17 00:00:00 2001 From: kimjaehyeon0101 <47347352-kimjaehyeon0101@users.noreply.replit.com> Date: Tue, 30 Sep 2025 03:07:47 +0000 Subject: [PATCH] Fix article navigation by updating navigation logic Update ArticleCard component to use `useLocation` hook from wouter for client-side navigation, replacing the direct `window.location.href` assignment. 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/pIEDxt1 --- client/src/components/ArticleCard.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/components/ArticleCard.tsx b/client/src/components/ArticleCard.tsx index 19addc9..bb4008d 100644 --- a/client/src/components/ArticleCard.tsx +++ b/client/src/components/ArticleCard.tsx @@ -1,5 +1,6 @@ import { Card, CardContent } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; +import { useLocation } from "wouter"; import type { Article, MediaOutlet } from "@shared/schema"; interface ArticleCardProps { @@ -9,8 +10,10 @@ interface ArticleCardProps { } export default function ArticleCard({ article, outlet, viewMode = "grid" }: ArticleCardProps) { + const [, setLocation] = useLocation(); + const handleClick = () => { - window.location.href = `/articles/${article.slug}`; + setLocation(`/articles/${article.slug}`); }; const formatDate = (date: string | Date) => {