-
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
Open
dhruv14122004
wants to merge
1
commit into
StabilityNexus:main
Choose a base branch
from
dhruv14122004:issue1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| "use client" | ||
|
|
||
| import Link from "next/link" | ||
| import { ArrowLeft, PenLine } from "lucide-react" | ||
|
|
||
| interface NavbarProps { | ||
| backHref?: string | ||
| backLabel?: string | ||
| ctaHref?: string | ||
| ctaLabel?: string | ||
| } | ||
|
|
||
| export function Navbar({ backHref, backLabel, ctaHref = "/submit", ctaLabel = "Submit article" }: NavbarProps) { | ||
| return ( | ||
| <header className="sticky top-0 z-50 border-b border-black/5 bg-white/90 backdrop-blur-md shadow-sm"> | ||
| <div className="max-w-6xl mx-auto px-4 py-3 flex items-center justify-between gap-4"> | ||
| <div className="flex items-center gap-3 min-w-0"> | ||
| {backHref && backLabel ? ( | ||
| <Link | ||
| href={backHref} | ||
| className="inline-flex items-center gap-2 rounded-full bg-gray-100 px-3 py-1.5 text-sm font-medium text-gray-700 hover:bg-gray-200 transition-colors" | ||
| > | ||
| <ArrowLeft className="h-4 w-4" /> | ||
| <span className="whitespace-nowrap">{backLabel}</span> | ||
| </Link> | ||
| ) : null} | ||
|
|
||
| <Link href="/" className="group flex items-center gap-3"> | ||
| <span className="relative inline-flex h-10 w-10 items-center justify-center overflow-hidden rounded-full bg-gradient-to-br from-[#228B22] via-[#91A511] to-[#FFBF00] shadow-sm ring-1 ring-black/5"> | ||
| <span className="absolute inset-0 bg-white/10 opacity-0 transition-opacity duration-300 group-hover:opacity-100" /> | ||
| <span className="text-xs font-semibold text-white">SV</span> | ||
| </span> | ||
| <span className="leading-tight"> | ||
| <span className="block text-lg font-semibold text-gray-900">Stable Viewpoints</span> | ||
| <span className="block text-xs text-gray-500">Independent articles on stability</span> | ||
| </span> | ||
| </Link> | ||
| </div> | ||
|
|
||
| <div className="flex items-center gap-2"> | ||
| <nav className="hidden sm:flex items-center gap-1 text-sm font-medium text-gray-700"> | ||
| <Link className="rounded-lg px-3 py-2 transition-colors hover:bg-gray-100" href="/"> | ||
| Home | ||
| </Link> | ||
| <Link className="rounded-lg px-3 py-2 transition-colors hover:bg-gray-100" href="/submit"> | ||
| Submit | ||
| </Link> | ||
| </nav> | ||
| {ctaHref && ctaLabel ? ( | ||
| <Link | ||
| href={ctaHref} | ||
| className="inline-flex items-center gap-2 rounded-full bg-gradient-to-r from-[#228B22] to-[#91A511] px-4 py-2 text-sm font-semibold text-white shadow-lg ring-1 ring-black/5 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-xl hover:from-[#3E921E] hover:to-[#ADAC0D]" | ||
| > | ||
| <PenLine className="h-4 w-4" /> | ||
| <span>{ctaLabel}</span> | ||
| </Link> | ||
| ) : null} | ||
| </div> | ||
| </div> | ||
| </header> | ||
| ) | ||
| } | ||
|
|
||
| export default Navbar |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, passctaHref={null} ctaLabel={null}(or equivalent).Also applies to: 15-15
🤖 Prompt for AI Agents