feat: Clickable Profile card and Our Project redirection to main repo#131
Conversation
|
@harish599 is attempting to deploy a commit to the recode Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces clickable interactions for the profile card on the homepage and the project tag in the OurProjects component, redirecting users to external URLs.
- Added onClick handler and cursor style to the homepage profile card for redirection
- Made the project tag in OurProjects clickable, linking to the GitHub repository
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/pages/index.tsx | Wrapped profile image container in a clickable div |
| src/components/ourProjects.tsx | Added onClick and cursor-pointer to the tag element |
| <div | ||
| className="m-4" | ||
| onClick={() => (window.location.href = "https://www.sanjaykv.com/")} | ||
| > | ||
| <img | ||
| src="/selfhero.png" | ||
| alt="recodehive" | ||
| className="w-full h-full object-cover rounded-2xl" | ||
| className="w-full h-full object-cover rounded-2xl cursor-pointer" | ||
| /> | ||
| </div> |
There was a problem hiding this comment.
Directly setting window.location.href bypasses SPA routing and may reload the entire app. Consider using Next.js or a routing utility to maintain client-side navigation.
| <div | ||
| className="cursor-pointer px-6 py-2 bg-gradient-to-r from-blue-500 to-purple-500 text-white rounded-full text-sm sm:text-base font-medium tracking-wide shadow-lg transform hover:scale-105 transition-transform duration-300" | ||
| onClick={() => | ||
| (window.location.href = "https://github.com/recodehive") | ||
| } | ||
| > | ||
| {tag} | ||
| </div> |
There was a problem hiding this comment.
Wrapping the tag in a clickable
| <div | |
| className="cursor-pointer px-6 py-2 bg-gradient-to-r from-blue-500 to-purple-500 text-white rounded-full text-sm sm:text-base font-medium tracking-wide shadow-lg transform hover:scale-105 transition-transform duration-300" | |
| onClick={() => | |
| (window.location.href = "https://github.com/recodehive") | |
| } | |
| > | |
| {tag} | |
| </div> | |
| <a | |
| href="https://github.com/recodehive" | |
| className="cursor-pointer px-6 py-2 bg-gradient-to-r from-blue-500 to-purple-500 text-white rounded-full text-sm sm:text-base font-medium tracking-wide shadow-lg transform hover:scale-105 transition-transform duration-300" | |
| > | |
| {tag} | |
| </a> |
| <div | ||
| className="cursor-pointer px-6 py-2 bg-gradient-to-r from-blue-500 to-purple-500 text-white rounded-full text-sm sm:text-base font-medium tracking-wide shadow-lg transform hover:scale-105 transition-transform duration-300" | ||
| onClick={() => | ||
| (window.location.href = "https://github.com/recodehive") | ||
| } | ||
| > | ||
| {tag} | ||
| </div> |
There was a problem hiding this comment.
Manipulating window.location.href directly triggers a full page reload. Consider using a proper link component or routing helper to preserve single-page app behavior.
| <div | |
| className="cursor-pointer px-6 py-2 bg-gradient-to-r from-blue-500 to-purple-500 text-white rounded-full text-sm sm:text-base font-medium tracking-wide shadow-lg transform hover:scale-105 transition-transform duration-300" | |
| onClick={() => | |
| (window.location.href = "https://github.com/recodehive") | |
| } | |
| > | |
| {tag} | |
| </div> | |
| <a | |
| href="https://github.com/recodehive" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| className="cursor-pointer px-6 py-2 bg-gradient-to-r from-blue-500 to-purple-500 text-white rounded-full text-sm sm:text-base font-medium tracking-wide shadow-lg transform hover:scale-105 transition-transform duration-300" | |
| > | |
| {tag} | |
| </a> |
|
Thanks @harish599 |
for issues #128 and #127