feat(HackathonSelector): add "New Hackathon" option to hackathon swit…#427
Conversation
|
@ryzen-xp is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a "New Hackathon" item to the hackathon switcher dropdown and passes an optional Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@components/organization/hackathons/details/HackathonSelector.tsx`:
- Around line 159-168: The New Hackathon menu item currently constructs
router.push(`/organizations/${organizationId}/hackathons/new`) directly and can
navigate to an invalid path when organizationId is undefined; create a named
handler (e.g., handleNewHackathonClick) and move the onClick logic into it, have
the handler first validate organizationId (return early or no-op if falsy), and
update the DropdownMenuItem to use this handler; alternatively conditionally
render or disable the DropdownMenuItem when organizationId is not present to
ensure navigation only occurs with a valid organizationId.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
components/organization/hackathons/details/HackathonSelector.tsxcomponents/organization/hackathons/details/HackathonSidebar.tsx
Closes #418
Adds a "New Hackathon" shortcut at the bottom of the hackathon switcher dropdown.
Changes
HackathonSelector.tsx— AddedorganizationIdprop, importedPlusandDropdownMenuSeparator, added conditional "New Hackathon" menu itemHackathonSidebar.tsx— AddedorganizationIdtoSidebarContentProps, passedderivedOrgIdtoHackathonSidebarContentand down toHackathonSelectorBehavior
hackathons.length > 0(no change to empty-statenullguard)/organizations/[id]/hackathons/newDropdownMenuSeparatorwithbg-[#2B2B2B]DropdownMenuItemconventionsSummary by CodeRabbit