From 2bec7a950c7bd3d3ef2c54b858630cb20bfdac6f Mon Sep 17 00:00:00 2001 From: Kapil Jangid Date: Sun, 20 Oct 2024 20:20:32 +0530 Subject: [PATCH] Refactor UserProject component: Add project thumbnail display and link functionality --- src/components/profile/UserProject.tsx | 53 +++++++++++++++++++------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/src/components/profile/UserProject.tsx b/src/components/profile/UserProject.tsx index 5da4af54..6df9edee 100644 --- a/src/components/profile/UserProject.tsx +++ b/src/components/profile/UserProject.tsx @@ -10,10 +10,12 @@ import { CardHeader, CardTitle, } from '../ui/card'; +import { LucideGithub, SquareArrowOutUpRightIcon } from 'lucide-react'; export function UserProjects() { const { toast } = useToast(); const [projects, setProjects] = useState(); + useEffect(() => { async function fetchProjects() { try { @@ -43,35 +45,58 @@ export function UserProjects() { } return ( -
+
{projects.map((item: Project) => ( +
+ {item.projectThumbnail ? ( + {item.projectName} + ) : ( +
+ + {item.projectName} + +
+ )} +
- + {item.projectName} - +

{item.projectSummary}

- {item.projectLiveLink && ( + {item.stack && ( +
+ Stack: + {item.stack} +
+ )} +
+ {item.projectLiveLink && ( + + + + )} - Live Project + - )} - - GitHub Repository - +
))}