-
Notifications
You must be signed in to change notification settings - Fork 29
Add Navbar component with back and call-to-action links #61
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA new reusable Navbar component is introduced and integrated across three pages (home, blog post, and submit) to centralize navigation UI and replace custom header implementations previously duplicated across these routes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 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: 1
🧹 Nitpick comments (2)
components/navbar.tsx (2)
6-11: Allow consumers to disable the CTA (current defaults force it on).
Right now, omittingctaHref/ctaLabelstill renders the CTA due to defaults, which makes it hard to avoid a self-link CTA on/submit. Consider supportingnull(or a boolean) to explicitly hide it.interface NavbarProps { backHref?: string backLabel?: string - ctaHref?: string - ctaLabel?: string + ctaHref?: string | null + ctaLabel?: string | null } -export function Navbar({ backHref, backLabel, ctaHref = "/submit", ctaLabel = "Submit article" }: NavbarProps) { +export function Navbar({ + backHref, + backLabel, + ctaHref = "/submit", + ctaLabel = "Submit article", +}: NavbarProps) { return ( @@ - {ctaHref && ctaLabel ? ( + {ctaHref && ctaLabel ? ( <Link href={ctaHref} @@ ) : null}Then consumers can do:
ctaHref={null} ctaLabel={null}to hide it.Also applies to: 13-63
13-64: Pick either named export or default export to avoid inconsistent imports.
Exporting both is fine, but it tends to drift across the codebase; consider keeping just one style.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
app/a/[slug]/BlogPostClient.tsx(1 hunks)app/page.tsx(2 hunks)app/submit/page.tsx(2 hunks)components/navbar.tsx(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
app/page.tsx (1)
components/navbar.tsx (1)
Navbar(13-62)
app/a/[slug]/BlogPostClient.tsx (2)
lib/blog.ts (1)
BlogPost(3-12)components/navbar.tsx (1)
Navbar(13-62)
app/submit/page.tsx (1)
components/navbar.tsx (1)
Navbar(13-62)
🔇 Additional comments (2)
app/a/[slug]/BlogPostClient.tsx (1)
3-3: Navbar integration looks good (consistent back navigation).Also applies to: 8-14
app/page.tsx (1)
9-10: LGTM: home page uses the shared Navbar cleanly.Also applies to: 100-103
| import { Upload, FileText, ImageIcon, CheckCircle, Users, MessageCircle } from "lucide-react" | ||
| import Footer from "@/components/footer" | ||
| import Navbar from "@/components/navbar" |
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.
Avoid CTA self-link on the Submit page.
With current Navbar defaults, this page will render a “Submit article” CTA that links to the current route (/submit). Once Navbar supports disabling CTA, pass ctaHref={null} ctaLabel={null} (or equivalent).
Also applies to: 15-15
🤖 Prompt for AI Agents
In app/submit/page.tsx around lines 2 to 4 and again at line 15, the page will
render the Navbar's default "Submit article" CTA which links to the current
/submit route; update the Navbar props to disable that CTA by passing
ctaHref={null} and ctaLabel={null} (or the equivalent props your Navbar accepts)
when rendering Navbar so the CTA does not self-link on this page.
Imporve the Navbar as it was looking very big and awkward #57

Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.