Skip to content

add new event#25

Open
mish-3000 wants to merge 1 commit intoCSEC-NITH:mainfrom
mish-3000:main
Open

add new event#25
mish-3000 wants to merge 1 commit intoCSEC-NITH:mainfrom
mish-3000:main

Conversation

@mish-3000
Copy link

No description provided.

@mish-3000 mish-3000 marked this pull request as ready for review March 8, 2026 20:41
Copilot AI review requested due to automatic review settings March 8, 2026 20:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.jsx to 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.

Comment on lines +98 to +104
"event": "CodeArena 26",
"image": "",
"date": "2026-04-15",
"desc": "The Ultimate Competitive Programming Battle",
"long_date": "April 15, 2026",
"long_desc": "",
"event_type": ""
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.
Comment on lines +56 to +58
{event.event === "CodeArena 26" && (
<Button
onClick={() => window.open("https://your-apply-link.com")}
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.
Comment on lines +56 to +64
{event.event === "CodeArena 26" && (
<Button
onClick={() => window.open("https://your-apply-link.com")}
className="explore-button w-full"
variant="outline"
>
Apply Now
</Button>
)}
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants