Skip to content

Commit 6180e37

Browse files
committed
refactor OSProgramCardComponent to handle external and internal guidelines links
1 parent 9b10499 commit 6180e37

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/Page/OpportunitiesHub/OpenSource.jsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,8 @@ const OSProgramCardComponent = ({
699699
}
700700
};
701701

702+
const isExternalGuidelines = guidelines?.startsWith('http');
703+
702704
return (
703705
<StyledOSProgramCard id={shareLink.substring(1)}>
704706
<div className="poster">
@@ -744,10 +746,17 @@ const OSProgramCardComponent = ({
744746
<h2 className="text-lg font-bold text-white">{title}</h2>
745747
<p className="text-center text-sm text-gray-300">{description}</p>
746748
<div className="info mt-2 flex flex-col items-center gap-1 rounded-lg border border-[#00a6fb] bg-gray-900 bg-opacity-50 px-14 py-3 text-sm text-white shadow-lg backdrop-blur-md transition-all hover:bg-gray-800">
747-
<a href={guidelines} target="_blank" rel="noopener noreferrer" className="flex items-center gap-2">
748-
<FontAwesomeIcon icon={faBookOpen} className="text-[#00a6fb]" />
749-
<span className="font-medium">Guidelines</span>
750-
</a>
749+
{isExternalGuidelines ? (
750+
<a href={guidelines} target="_blank" rel="noopener noreferrer" className="flex items-center gap-2">
751+
<FontAwesomeIcon icon={faBookOpen} className="text-[#00a6fb]" />
752+
<span className="font-medium">Guidelines</span>
753+
</a>
754+
) : (
755+
<Link to={guidelines} className="flex items-center gap-2">
756+
<FontAwesomeIcon icon={faBookOpen} className="text-[#00a6fb]" />
757+
<span className="font-medium">Guidelines</span>
758+
</Link>
759+
)}
751760
</div>
752761
</div>
753762
</div>
@@ -764,7 +773,7 @@ const OSProgramList = [
764773
timeline: 'March 2025',
765774
Duration: 'May - August 2025',
766775
type: 'Student-friendly, Open Source',
767-
guidelines: 'https://summerofcode.withgoogle.com/',
776+
guidelines: '/OpenSource/gsoc',
768777
applyLink: 'https://summerofcode.withgoogle.com/',
769778
poster: '/assets/opensourceProgram/GSoC.png',
770779
shareLink: '#gsoc2026',

0 commit comments

Comments
 (0)