Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new event (“CodeArena 26”) to the site’s event data and updates the Events carousel UI to show an additional call-to-action for that event.
Changes:
- Added “CodeArena 26” to upcoming and past events JSON data.
- Updated
Events.jsxto show an “Apply Now” button for “CodeArena 26” in addition to “Explore”.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/utils/upcoming_events.json |
Appends the new event to the upcoming events list. |
src/utils/past_events.json |
Appends the new event to the events list used by the Events carousel/detail page. |
src/components/Events.jsx |
Adds a conditional “Apply Now” CTA for the new event and keeps “Explore”. |
Comments suppressed due to low confidence (1)
src/utils/upcoming_events.json:26
- The JSON array is missing its closing "]" at the end of the file, which makes this invalid JSON and will break any import/parse of upcoming_events.json. Add the closing bracket (and keep formatting consistent with the rest of the file).
{
"event":"CodeArena 26",
"desc":"",
"image":"",
"date":"2026-04-15"
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "event": "CodeArena 26", | ||
| "image": "", | ||
| "date": "2026-04-15", | ||
| "desc": "The Ultimate Competitive Programming Battle", | ||
| "long_date": "April 15, 2026", | ||
| "long_desc": "", | ||
| "event_type": "" |
There was a problem hiding this comment.
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.
| {event.event === "CodeArena 26" && ( | ||
| <Button | ||
| onClick={() => window.open("https://your-apply-link.com")} |
There was a problem hiding this comment.
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.
| {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") | |
| } |
| {event.event === "CodeArena 26" && ( | ||
| <Button | ||
| onClick={() => window.open("https://your-apply-link.com")} | ||
| className="explore-button w-full" | ||
| variant="outline" | ||
| > | ||
| Apply Now | ||
| </Button> | ||
| )} |
There was a problem hiding this comment.
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.
| )} | ||
|
|
||
| <Button | ||
| onClick={() => router.push(`/events/${event.event}`)} |
There was a problem hiding this comment.
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.
| onClick={() => router.push(`/events/${event.event}`)} | |
| onClick={() => router.push(`/events/${encodeURIComponent(event.event)}`)} |
No description provided.