feat(21-03): rewire card click handlers to navigate to detail pages
- ItemCard navigates to /items/$itemId instead of opening edit panel - CandidateCard navigates to /threads/$threadId/candidates/$candidateId - CandidateListItem navigates to candidate detail page - CatalogSearchOverlay cards navigate to /global-items/$globalItemId - Add button on catalog cards uses stopPropagation to prevent navigation
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import { useFormatters } from "../hooks/useFormatters";
|
||||
import type { CandidateDelta } from "../hooks/useImpactDeltas";
|
||||
import { LucideIcon } from "../lib/iconData";
|
||||
@@ -46,7 +47,7 @@ export function CandidateCard({
|
||||
delta,
|
||||
}: CandidateCardProps) {
|
||||
const { weight, price } = useFormatters();
|
||||
const openCandidateEditPanel = useUIStore((s) => s.openCandidateEditPanel);
|
||||
const navigate = useNavigate();
|
||||
const openConfirmDeleteCandidate = useUIStore(
|
||||
(s) => s.openConfirmDeleteCandidate,
|
||||
);
|
||||
@@ -56,7 +57,12 @@ export function CandidateCard({
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => openCandidateEditPanel(id)}
|
||||
onClick={() =>
|
||||
navigate({
|
||||
to: "/threads/$threadId/candidates/$candidateId",
|
||||
params: { threadId: String(threadId), candidateId: String(id) },
|
||||
})
|
||||
}
|
||||
className="relative w-full text-left bg-white rounded-xl border border-gray-100 hover:border-gray-200 hover:shadow-sm transition-all overflow-hidden group"
|
||||
>
|
||||
{/* Hover-reveal action buttons */}
|
||||
|
||||
Reference in New Issue
Block a user