-
Notifications
You must be signed in to change notification settings - Fork 283
Fix: Make project card links clickable on /projects page #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Someone is attempting to deploy a commit to the AOSSIE Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe PR converts a static project link display into a functional hyperlink by replacing the text container Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related issues
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/pages/projects.jsx (1)
86-94: LGTM! The fix correctly makes project links clickable.The anchor element properly addresses the bug with correct security attributes (
rel="noopener noreferrer") for external links opening in new tabs. The hover styling for both light and dark modes is maintained.Optional enhancement: Consider using Material-UI's Link component for consistency.
Since the project already uses Material-UI components throughout, you could optionally use the
Linkcomponent from@mui/materialinstead of a plain<a>tag for better consistency:+import Link from '@mui/material/Link';Then in the CardActions:
- <a - href={project.link.href} - target="_blank" - rel="noopener noreferrer" - className="relative z-10 mt-6 flex text-md font-semibold font-mono text-zinc-600 dark:text-zinc-200 hover:text-[#00843D] dark:hover:text-yellow-400" - > + <Link + href={project.link.href} + target="_blank" + rel="noopener noreferrer" + underline="none" + className="relative z-10 mt-6 flex text-md font-semibold font-mono text-zinc-600 dark:text-zinc-200 hover:text-[#00843D] dark:hover:text-yellow-400" + > <LinkIcon className="h-6 w-6 flex-none scale-110" /> <span className="ml-2">{project.link.label}</span> - </a> + </Link>Optional accessibility enhancement:
You could add an
aria-labelto provide more context:<a href={project.link.href} target="_blank" rel="noopener noreferrer" + aria-label={`Visit ${project.name} repository`} className="relative z-10 mt-6 flex text-md font-semibold font-mono text-zinc-600 dark:text-zinc-200 hover:text-[#00843D] dark:hover:text-yellow-400" >
Description
This PR fixes a bug on the
/projectspage where the project links (e.g., "Agora", "EduAid") were not clickable, preventing users from visiting the project repositories.The Problem
The UI was rendering the project link and icon inside a
<p>(paragraph) tag instead of an<a>(anchor) tag. This displayed the text correctly but provided no click functionality, even though the correct URLs were available in the data file.File:
src/pages/projects.jsxOld (Broken) Code:
The Solution
I have replaced the
<p>element with a functional<a>tag.project.link.hreffor the link's destination.target="_blank"andrel="noopener noreferrer"to securely open the link in a new tab.New (Fixed) Code:
How to Test
npm install(if needed) and thennpm run dev./projectspage in your browser.Additional Note
As mentioned in the original bug report, the "OpenChat" project has its
hrefset to"#"in the data file. This PR fixes the UI component, but that specific project will still not lead to a valid destination.Summary by CodeRabbit