- Notifications
You must be signed in to change notification settings - Fork 0
feature: add navbar with shadcn/ui theming#4
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
95f40e574826f3a66d3e4c275611f6e53e6File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "$schema": "https://ui.shadcn.com/schema.json", | ||
| "style": "new-york", | ||
| "rsc": true, | ||
| "tsx": true, | ||
| "tailwind": { | ||
| "config": "", | ||
| "css": "globals.css", | ||
| "baseColor": "slate", | ||
| "cssVariables": true, | ||
| "prefix": "" | ||
| }, | ||
| "iconLibrary": "lucide", | ||
| "aliases": { | ||
| "components": "@/components", | ||
| "utils": "@/lib/utils", | ||
| "ui": "@/components/ui", | ||
| "lib": "@/lib", | ||
| "hooks": "@/hooks" | ||
| }, | ||
| "registries": {} | ||
| } |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||||||||||
| import Image from "next/image"; | ||||||||||||||
| import Link from "next/link"; | ||||||||||||||
| import { ThemeToggle } from "@/components/navigation/theme-toggle"; | ||||||||||||||
| export const Navbar = () => ( | ||||||||||||||
| <nav | ||||||||||||||
| aria-label="Primary navigation" | ||||||||||||||
| className="sticky top-0 z-50 grid w-full grid-cols-3 items-center bg-sidebar px-6 py-4 shadow-sm" | ||||||||||||||
| > | ||||||||||||||
| {/* Left: Logo + DevFlow text */} | ||||||||||||||
| <Link href="/" className="flex items-center gap-2 justify-self-start"> | ||||||||||||||
| <Image | ||||||||||||||
| src="/images/site-logo.svg" | ||||||||||||||
| alt="DevFlow logo" | ||||||||||||||
| width={25} | ||||||||||||||
| height={25} | ||||||||||||||
| /> | ||||||||||||||
| <h2 className="hidden font-display text-2xl font-semibold text-sidebar-foreground sm:block"> | ||||||||||||||
| Dev<span className="text-primary">Flow</span> | ||||||||||||||
| </h2> | ||||||||||||||
Comment on lines
+18
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider revising heading level for improved document outline. Using Example refactor using - <h2 className="hidden font-display text-2xl font-semibold text-sidebar-foreground sm:block">+ <span className="hidden font-display text-2xl font-semibold text-sidebar-foreground sm:block">
Dev<span className="text-primary">Flow</span>
- </h2>+ </span>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents | ||||||||||||||
| </Link> | ||||||||||||||
| {/* Centre: Global Search placeholder */} | ||||||||||||||
| <p className="hidden justify-self-center text-sidebar-foreground sm:block"> | ||||||||||||||
| Global Search | ||||||||||||||
| </p> | ||||||||||||||
| {/* Right: Theme toggle */} | ||||||||||||||
| <div className="justify-self-end"> | ||||||||||||||
| <ThemeToggle /> | ||||||||||||||
| </div> | ||||||||||||||
| </nav> | ||||||||||||||
| ); | ||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| "use client"; | ||
| import { Sun } from "lucide-react"; | ||
| import { useTheme } from "next-themes"; | ||
| import { useEffect, useState } from "react"; | ||
| import { Button } from "@/components/ui/button"; | ||
| export function ThemeToggle() { | ||
| const { theme, setTheme } = useTheme(); | ||
| const [mounted, setMounted] = useState(false); | ||
| useEffect(() => setMounted(true), []); | ||
| if (!mounted) { | ||
| return <div className="size-10" aria-hidden="true" />; | ||
| } | ||
| return ( | ||
| <Button | ||
| variant="ghost" | ||
| size="icon-lg" | ||
| onClick={() => setTheme(theme === "dark" ? "light" : "dark")} | ||
| className="text-sidebar-foreground" | ||
| aria-label={`Switch to ${theme === "dark" ? "light" : "dark"} theme`} | ||
| > | ||
| <Sun | ||
| className="size-6" | ||
| fill={theme === "light" ? "currentColor" : "none"} | ||
| /> | ||
| </Button> | ||
| ); | ||
michellepace marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.