From b6f69688e1dc2976ec8d5fd93583553e188595a3 Mon Sep 17 00:00:00 2001 From: raineer Date: Wed, 19 Nov 2025 02:10:18 +0800 Subject: [PATCH 1/2] Card Click Redirect Implementationbe a codev --- .../_components/landing/LandingIntern-CodevCard.tsx | 3 +++ .../(marketing)/profiles/_components/CodevCard.tsx | 11 ++++++++--- .../app/home/in-house/_components/cards/CodevCard.tsx | 6 ++++-- .../orgchart/_components/OrgChartTeamMemberCard.tsx | 10 ++++++++-- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/apps/codebility/app/(marketing)/_components/landing/LandingIntern-CodevCard.tsx b/apps/codebility/app/(marketing)/_components/landing/LandingIntern-CodevCard.tsx index 718b772e0..58bc08bd3 100644 --- a/apps/codebility/app/(marketing)/_components/landing/LandingIntern-CodevCard.tsx +++ b/apps/codebility/app/(marketing)/_components/landing/LandingIntern-CodevCard.tsx @@ -6,6 +6,7 @@ import { motion, useInView } from "framer-motion"; import { Card, CardContent } from "@/components/ui/card"; type Person = { + id: string; // ✅ Added id field for navigation name: string; role: 'Intern' | 'Codev'; // Only two possible roles from database image?: string; // image URL (optional) @@ -231,6 +232,8 @@ export default function InternCards({ interns }: { interns: Person[] }) { }} whileTap={{ scale: 0.95 }} style={{ perspective: "1000px" }} + onClick={() => window.location.href = `https://www.codebility.tech/profiles/${intern.id}`} + className="cursor-pointer" > { : {}; }, [codev.level, codev.codev_points]); + // Line 119: Enhanced card wrapper with click redirect return (
setHovered(true)} onMouseLeave={() => setHovered(false)} > -
+
window.location.href = `https://www.codebility.tech/profiles/${codev.id}`} + className="group relative flex h-full w-full flex-col items-center justify-between rounded-lg border border-white/20 bg-white/10 p-4 shadow-2xl backdrop-blur-md transition-all duration-300 cursor-pointer hover:bg-white/20 hover:scale-[1.02] dark:border-white/10 dark:bg-white/5 dark:hover:bg-white/10" + > {/* Background decoration */}
@@ -197,7 +201,8 @@ const CodevCard = ({ codev, color }: Props) => { - + {/* Line 217: Added stopPropagation to prevent card click when button is clicked */} + e.stopPropagation()}>
@@ -182,10 +183,11 @@ export function CodevCard({ data, onEdit, onDelete, roles }: CodevCardProps) { + {/* Line 138: Enhanced View button with actual profile navigation */}