Add tailwind navbar
This commit is contained in:
@@ -27,8 +27,8 @@ export default function Home() {
|
|||||||
<h3 className="text-lg font-semibold text-center text-gray-700 mb-2">
|
<h3 className="text-lg font-semibold text-center text-gray-700 mb-2">
|
||||||
Photo Comparison
|
Photo Comparison
|
||||||
</h3>
|
</h3>
|
||||||
<div className="flex justify-center space-x-4 w-full">
|
<div className="flex flex-col md:flex-row justify-center space-y-4 md:space-y-0 md:space-x-4 w-full">
|
||||||
<div className="w-1/4 p-4 bg-gray-100 rounded-lg shadow-md border-2 border-solid border-color-indigo-500">
|
<div className="w-full md:w-1/2 p-4 bg-gray-100 rounded-lg shadow-md border-2 border-solid border-color-indigo-500">
|
||||||
<h4 className="text-sm font-semibold text-center text-gray-700 mb-1">
|
<h4 className="text-sm font-semibold text-center text-gray-700 mb-1">
|
||||||
Before
|
Before
|
||||||
</h4>
|
</h4>
|
||||||
@@ -40,7 +40,7 @@ export default function Home() {
|
|||||||
className="w-full h-auto rounded"
|
className="w-full h-auto rounded"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-1/4 p-4 bg-gray-100 rounded-lg shadow-md border-2 border-solid border-color-indigo-500">
|
<div className="w-full md:w-1/2 p-4 bg-gray-100 rounded-lg shadow-md border-2 border-solid border-color-indigo-500">
|
||||||
<h4 className="text-sm font-semibold text-center text-gray-700 mb-1">
|
<h4 className="text-sm font-semibold text-center text-gray-700 mb-1">
|
||||||
After
|
After
|
||||||
</h4>
|
</h4>
|
||||||
@@ -53,7 +53,7 @@ export default function Home() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-8 text-center">
|
<div className="max-w-4xl mx-auto mt-8 text-center">
|
||||||
<h3 className="text-lg font-semibold text-gray-700 mb-2">
|
<h3 className="text-lg font-semibold text-gray-700 mb-2">
|
||||||
What Happened?
|
What Happened?
|
||||||
</h3>
|
</h3>
|
||||||
|
|||||||
@@ -1,46 +1,189 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
|
import { useState } from "react"
|
||||||
|
|
||||||
interface HeaderProps {
|
interface HeaderProps {
|
||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const navigation = [
|
||||||
|
{ name: 'Dashboard', href: '/dashboard', current: true },
|
||||||
|
{ name: 'Projects', href: '/projects', current: false },
|
||||||
|
{ name: 'Calendar', href: '/calendar', current: false },
|
||||||
|
{ name: 'Reports', href: '/reports', current: false },
|
||||||
|
]
|
||||||
|
|
||||||
export function Header({ className }: HeaderProps) {
|
export function Header({ className }: HeaderProps) {
|
||||||
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
|
||||||
|
const [profileOpen, setProfileOpen] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header
|
<header className={cn("bg-gray-900 shadow-sm", className)}>
|
||||||
className={cn(
|
<nav className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||||
"flex items-center justify-center p-4 border-b border-border w-full",
|
<div className="flex h-16 items-center justify-between">
|
||||||
className
|
<div className="flex items-center">
|
||||||
)}
|
<div className="flex-shrink-0">
|
||||||
>
|
|
||||||
<div className="flex items-center w-full max-w-screen-xl mx-auto">
|
|
||||||
<div className="flex items-center gap-4">
|
|
||||||
<Link href="/">
|
<Link href="/">
|
||||||
<img src="/logo.svg" alt="Logo" className="h-8 w-8" />
|
<img
|
||||||
|
className="h-8 w-auto"
|
||||||
|
src="/logo.svg"
|
||||||
|
alt="Your Company"
|
||||||
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<nav className="flex items-center gap-6 ml-auto">
|
<div className="hidden md:block">
|
||||||
|
<div className="ml-10 flex items-baseline space-x-4">
|
||||||
|
{navigation.map((item) => (
|
||||||
<Link
|
<Link
|
||||||
href="/login"
|
key={item.name}
|
||||||
className="text-sm font-medium text-foreground hover:underline"
|
href={item.href}
|
||||||
|
className={cn(
|
||||||
|
item.current
|
||||||
|
? 'bg-gray-800 text-white'
|
||||||
|
: 'text-gray-300 hover:bg-gray-700 hover:text-white',
|
||||||
|
'rounded-md px-3 py-2 text-sm font-medium transition-colors'
|
||||||
|
)}
|
||||||
|
aria-current={item.current ? 'page' : undefined}
|
||||||
>
|
>
|
||||||
Login
|
{item.name}
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
))}
|
||||||
href="/pricing"
|
</div>
|
||||||
className="text-sm font-medium text-foreground hover:underline"
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="hidden md:block">
|
||||||
|
<div className="ml-4 flex items-center md:ml-6">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="relative rounded-full bg-gray-800 p-1 text-gray-400 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800"
|
||||||
>
|
>
|
||||||
Pricing
|
<span className="absolute -inset-1.5" />
|
||||||
</Link>
|
<span className="sr-only">View notifications</span>
|
||||||
<Link
|
<svg className="h-6 w-6" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
|
||||||
href="/about"
|
<path strokeLinecap="round" strokeLinejoin="round" d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" />
|
||||||
className="text-sm font-medium text-foreground hover:underline"
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{/* Profile dropdown */}
|
||||||
|
<div className="relative ml-3">
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="relative flex max-w-xs items-center rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800"
|
||||||
|
onClick={() => setProfileOpen(!profileOpen)}
|
||||||
>
|
>
|
||||||
About
|
<span className="absolute -inset-1.5" />
|
||||||
|
<span className="sr-only">Open user menu</span>
|
||||||
|
<img
|
||||||
|
className="h-8 w-8 rounded-full"
|
||||||
|
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{profileOpen && (
|
||||||
|
<div className="absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
|
||||||
|
<Link href="/profile" className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
||||||
|
Your Profile
|
||||||
</Link>
|
</Link>
|
||||||
|
<Link href="/settings" className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
||||||
|
Settings
|
||||||
|
</Link>
|
||||||
|
<Link href="/logout" className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
||||||
|
Sign out
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="-mr-2 flex md:hidden">
|
||||||
|
{/* Mobile menu button */}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="relative inline-flex items-center justify-center rounded-md bg-gray-800 p-2 text-gray-400 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white"
|
||||||
|
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
|
||||||
|
>
|
||||||
|
<span className="absolute -inset-0.5" />
|
||||||
|
<span className="sr-only">Open main menu</span>
|
||||||
|
{mobileMenuOpen ? (
|
||||||
|
<svg className="block h-6 w-6" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
|
||||||
|
<path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
|
||||||
|
</svg>
|
||||||
|
) : (
|
||||||
|
<svg className="block h-6 w-6" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
|
||||||
|
<path strokeLinecap="round" strokeLinejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
{/* Mobile menu */}
|
||||||
|
{mobileMenuOpen && (
|
||||||
|
<div className="md:hidden">
|
||||||
|
<div className="space-y-1 px-2 pb-3 pt-2 sm:px-3">
|
||||||
|
{navigation.map((item) => (
|
||||||
|
<Link
|
||||||
|
key={item.name}
|
||||||
|
href={item.href}
|
||||||
|
className={cn(
|
||||||
|
item.current
|
||||||
|
? 'bg-gray-900 text-white'
|
||||||
|
: 'text-gray-300 hover:bg-gray-700 hover:text-white',
|
||||||
|
'block rounded-md px-3 py-2 text-base font-medium transition-colors'
|
||||||
|
)}
|
||||||
|
aria-current={item.current ? 'page' : undefined}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="border-t border-gray-700 pb-3 pt-4">
|
||||||
|
<div className="flex items-center px-5">
|
||||||
|
<div className="flex-shrink-0">
|
||||||
|
<img
|
||||||
|
className="h-10 w-10 rounded-full"
|
||||||
|
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="ml-3">
|
||||||
|
<div className="text-base font-medium leading-none text-white">User Name</div>
|
||||||
|
<div className="text-sm font-medium leading-none text-gray-400">user@example.com</div>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="relative ml-auto flex-shrink-0 rounded-full bg-gray-800 p-1 text-gray-400 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800"
|
||||||
|
>
|
||||||
|
<span className="absolute -inset-1.5" />
|
||||||
|
<span className="sr-only">View notifications</span>
|
||||||
|
<svg className="h-6 w-6" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor">
|
||||||
|
<path strokeLinecap="round" strokeLinejoin="round" d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="mt-3 space-y-1 px-2">
|
||||||
|
<Link href="/profile" className="block rounded-md px-3 py-2 text-base font-medium text-gray-400 hover:bg-gray-700 hover:text-white">
|
||||||
|
Your Profile
|
||||||
|
</Link>
|
||||||
|
<Link href="/settings" className="block rounded-md px-3 py-2 text-base font-medium text-gray-400 hover:bg-gray-700 hover:text-white">
|
||||||
|
Settings
|
||||||
|
</Link>
|
||||||
|
<Link href="/logout" className="block rounded-md px-3 py-2 text-base font-medium text-gray-400 hover:bg-gray-700 hover:text-white">
|
||||||
|
Sign out
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</header>
|
</header>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user