Skip to content

Commit

Permalink
navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinMatheka-1 committed Jan 27, 2024
1 parent fade515 commit a3187f9
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ export function Hero() {
</div>

<div>
<Link href="https://github.com/humberni/halley/blob/main/README.md" target="_blank">
<button className="bg-green-500 text-white text-base rounded-full px-4 p-2 font-medium">
Documentation
</button>
</Link>

</div>
</div>
</div>
Expand Down
123 changes: 123 additions & 0 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import Link from "next/link";
import Image from "next/image";
import ThemeSwitchButton from "./ThemeSwitchButton";

import { Disclosure } from "@headlessui/react";
import { Bars3Icon } from "@heroicons/react/24/solid";
import { XMarkIcon } from "@heroicons/react/24/solid";

const navigation = [
{ name: "Home", href: "/", current: false },
{ name: "Why CtrlSend", href: "#services", current: false },
// { name: "Pricing", href: "#pricing", current: false },
{ name: "Faq", href: "#faq", current: false },
{ name: "Contact", href: "#contact", current: false },
];

function classNames(...classes: any) {
return classes.filter(Boolean).join(" ");
}

export default function Navbar() {
return (
<Disclosure
as="nav"
className=" fixed top-0 left-0 right-0 bg-white dark:bg-neutral-900 text-neutral-900 dark:text-neutral-400 border-b border-neutral-200 dark:border-neutral-700 backdrop-blur-sm bg-white/90 dark:bg-neutral-900/80 z-20"
>
{({ open }: { open: any }) => (
<>
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="relative flex h-16 items-center justify-between">
<div className="flex flex-1 items-center justify-start">
<div className="flex flex-shrink-0 items-center md:pl-0">
<Link href="/">
<Image
className="block h-8 w-auto"
src="/images/logos/ctrlsendlogo.png"
alt="Logo Your Company"
width={180}
height={180}
quality={75}
sizes="150vw"
/>
</Link>
</div>

<div className="hidden sm:ml-6 sm:block">
<div className="flex space-x-5 items-center">
{navigation.map((item) => (
<Link
key={item.name}
href={item.href}
className={classNames(
item.current
? "text-neutral-900 dark:text-neutral-400 "
: "text-neutral-900 dark:text-neutral-400 hover:underline",
"text-base font-medium"
)}
aria-current={item.current ? "page" : undefined}
>
{item.name}
</Link>
))}
</div>
</div>

<div className="absolute inset-y-0 right-10 sm:right-0 flex items-center gap-2">
<Link
href="https://github.com/KelvinMatheka-1"
target="_blank"
className="hidden sm:block"
>
<button className="bg-neutral-900 dark:bg-white text-white dark:text-neutral-900 px-4 p-2 text-base font-medium dark:hover:bg-green-500 hover:bg-green-500 hover:text-white dark:hover:text-white rounded-full">
GitHub
</button>
</Link>
<ThemeSwitchButton />
</div>

<div className="absolute inset-y-0 right-0 flex items-center sm:hidden">
{/* Mobile menu button*/}
<Disclosure.Button className="inline-flex items-center justify-center rounded-md text-neutral-900 dark:text-white ">
<span className="sr-only">Open main menu</span>
{open ? (
<XMarkIcon className="block h-6 w-6" aria-hidden="true" />
) : (
<Bars3Icon className="block h-6 w-6" aria-hidden="true" />
)}
</Disclosure.Button>
</div>
</div>
</div>
</div>

<Disclosure.Panel className="sm:hidden">
<div className="space-y-1 px-4 min-h-screen border-t border-neutral-200 dark:border-neutral-700 bg-white dark:bg-neutral-900">
{navigation.map((item) => (
<Disclosure.Button
key={item.name}
as="a"
href={item.href}
className={classNames(
item.current
? "text-neutral-900 dark:text-neutral-400"
: "text-neutral-900 dark:text-neutral-400",
"block py-4 text-base font-medium border-b border-neutral-200 dark:border-neutral-700"
)}
aria-current={item.current ? "page" : undefined}
>
{item.name}
</Disclosure.Button>
))}
<Link href="https://github.com/humberni/halley" target="_blank">
<button className="mt-12 bg-rose-500 text-white px-4 p-3 font-medium rounded-full w-full">
GitHub
</button>
</Link>
</div>
</Disclosure.Panel>
</>
)}
</Disclosure>
);
}

0 comments on commit a3187f9

Please sign in to comment.