-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add Marketplace link to partner program dropdown #3217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Introduces a conditional 'Marketplace' link in the partner program dropdown, visible only to partners who meet the marketplace view requirements. Imports the necessary utility and icon for this feature.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe pull request adds a Marketplace link to the partner program dropdown sidebar. It imports a permission check function and Shop icon, conditionally computes visibility based on partner enrollment status, and renders the Marketplace navigation link when authorized. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/web/ui/layout/sidebar/partner-program-dropdown.tsx (1)
47-49: Optionally coercecanViewMarketplaceto a strict booleanThe current expression works, but
programEnrollments && partnerCanViewMarketplace(...)can infer a non-boolean union type. If you wantcanViewMarketplaceto be guaranteedboolean, you could do:- const canViewMarketplace = - programEnrollments && - partnerCanViewMarketplace({ partner, programEnrollments }); + const canViewMarketplace = + !!programEnrollments && + partnerCanViewMarketplace({ partner, programEnrollments });Semantics remain the same while making the intent and type a bit clearer.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/web/ui/layout/sidebar/partner-program-dropdown.tsx(4 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-08-25T21:03:24.285Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2736
File: apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-card.tsx:1-1
Timestamp: 2025-08-25T21:03:24.285Z
Learning: In Next.js App Router, Server Components that use hooks can work without "use client" directive if they are only imported by Client Components, as they get "promoted" to run on the client side within the Client Component boundary.
Applied to files:
apps/web/ui/layout/sidebar/partner-program-dropdown.tsx
📚 Learning: 2025-09-24T16:10:37.349Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2872
File: apps/web/ui/partners/partner-about.tsx:11-11
Timestamp: 2025-09-24T16:10:37.349Z
Learning: In the Dub codebase, the team prefers to import Icon as a runtime value from "dub/ui" and uses Icon as both a type and variable name in component props, even when this creates shadowing. This is their established pattern and should not be suggested for refactoring.
Applied to files:
apps/web/ui/layout/sidebar/partner-program-dropdown.tsx
📚 Learning: 2025-10-15T01:05:43.266Z
Learnt from: steven-tey
Repo: dubinc/dub PR: 2958
File: apps/web/app/app.dub.co/(dashboard)/[slug]/settings/members/page-client.tsx:432-457
Timestamp: 2025-10-15T01:05:43.266Z
Learning: In apps/web/app/app.dub.co/(dashboard)/[slug]/settings/members/page-client.tsx, defer refactoring the custom MenuItem component (lines 432-457) to use the shared dub/ui MenuItem component to a future PR, as requested by steven-tey.
Applied to files:
apps/web/ui/layout/sidebar/partner-program-dropdown.tsx
🧬 Code graph analysis (1)
apps/web/ui/layout/sidebar/partner-program-dropdown.tsx (2)
apps/web/lib/network/get-discoverability-requirements.ts (1)
partnerCanViewMarketplace(34-51)packages/ui/src/icons/nucleo/shop.tsx (1)
Shop(3-65)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (2)
apps/web/ui/layout/sidebar/partner-program-dropdown.tsx (2)
3-14: Imports for marketplace permission and icon look correctThe new imports for
partnerCanViewMarketplaceandShopare consistent with existing module structure and icon usage in this file; no issues here.
94-108: Marketplace link conditional rendering is consistent and well-integratedThe new Marketplace link correctly mirrors the “All programs” item styling, is properly gated by
canViewMarketplace, and closes the popover on click. This fits cleanly into the existing dropdown UX.
Introduces a conditional 'Marketplace' link in the partner program dropdown, visible only to partners who meet the marketplace view requirements. Imports the necessary utility and icon for this feature.
Summary by CodeRabbit
New Features
✏️ Tip: You can customize this high-level summary in your review settings.