Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions src/components/Events.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,26 @@ const Events = () => {
</div>
</CardContent>
<CardFooter>
<Button
onClick={() => router.push(`/events/${event.event}`)}
className="explore-button w-full"
variant="outline"
>
Explore
</Button>
</CardFooter>

{event.event === "CodeArena 26" && (
<Button
onClick={() => window.open("https://your-apply-link.com")}
Comment on lines +56 to +58
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

window.open("https://your-apply-link.com") looks like a placeholder and will ship a non-functional CTA. Also consider opening with noopener,noreferrer (or using a normal link component) to avoid reverse-tabnabbing issues when opening external sites.

Suggested change
{event.event === "CodeArena 26" && (
<Button
onClick={() => window.open("https://your-apply-link.com")}
{event.event === "CodeArena 26" && event.applyLink && (
<Button
onClick={() =>
window.open(event.applyLink, "_blank", "noopener,noreferrer")
}

Copilot uses AI. Check for mistakes.
className="explore-button w-full"
variant="outline"
>
Apply Now
</Button>
)}
Comment on lines +56 to +64
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coding event.event === "CodeArena 26" couples UI behavior to a specific display name. This will be fragile if the name changes and doesn’t scale to future events; consider driving this from event data (e.g., an applyUrl field) and rendering the CTA when that field is present.

Copilot uses AI. Check for mistakes.

<Button
onClick={() => router.push(`/events/${event.event}`)}
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

router.push(/events/${event.event}) now needs to handle event identifiers that include spaces (e.g., "CodeArena 26"). To avoid malformed URLs / mismatch with useParams(), use a URL-safe identifier (slug) or explicitly encode the segment before pushing.

Suggested change
onClick={() => router.push(`/events/${event.event}`)}
onClick={() => router.push(`/events/${encodeURIComponent(event.event)}`)}

Copilot uses AI. Check for mistakes.
className="explore-button w-full"
variant="outline"
>
Explore
</Button>

</CardFooter>
</Card>
);

Expand Down
11 changes: 10 additions & 1 deletion src/utils/past_events.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,14 @@
"long_date": "Coming soon..",
"long_desc": "An Intern Talk is an event organized by a society where current interns and recent graduates share their experiences, insights, and advice on navigating the world of internships and early-career opportunities. This event provides a platform for interns to discuss their internship journeys, challenges faced, lessons learned, and tips for success. Attendees will hear from a diverse panel of speakers who have completed internships in various industries, companies, and roles, offering valuable perspectives and practical advice. The Intern Talk covers topics such as finding internships, preparing for interviews, adapting to new work environments, building professional relationships, and making the most of internship experiences. Participants will have the opportunity to ask questions, engage in discussions, and connect with peers who are embarking on their internship journeys. Whether you are a student seeking internship opportunities or an intern looking to enhance your skills, the Intern Talk offers valuable insights and guidance to help you navigate the internship landscape and kickstart your career. Join us for an informative and inspiring event that empowers interns to thrive in their professional development journey.",
"event_type": "Virtual Event"
},
{
"event": "CodeArena 26",
"image": "",
"date": "2026-04-15",
"desc": "The Ultimate Competitive Programming Battle",
"long_date": "April 15, 2026",
"long_desc": "",
"event_type": ""
Comment on lines +98 to +104
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This event name contains a space and is also used as the URL segment for the event detail route (via /events/${event.event}) and as a lookup key (events.find(...)). Consider introducing a URL-safe slug/id (e.g., eventId) or ensure the value is consistently encoded/decoded, otherwise navigation/lookups can fail for names with spaces or special characters.

Copilot uses AI. Check for mistakes.
}
]
]
7 changes: 6 additions & 1 deletion src/utils/upcoming_events.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@
"desc":"Basics to Linux workshop was an engaging event that introduced participants to the basics of the Linux operating system. Participants learned how to navigate the Linux file system, use the command line interface, and perform common tasks like creating files, directories, and running programs. They also learned about the history of Linux and its importance in the tech industry.",
"image":"https://images.unsplash.com/photo-1720887236665-43caad593cdf?q=80&w=1836&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
"date":"Coming soon.."
},
{
"event":"CodeArena 26",
"desc":"",
"image":"",
"date":"2026-04-15"
}
]
Loading