-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat: initialize navbar #19
Open
hetd54
wants to merge
12
commits into
main
Choose a base branch
from
feat-navbar
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.
+420
−37
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
de5ce4d
feat: ccv logo
hetd54 a446f4d
feat: brown logo
hetd54 bfd8b36
Merge branch 'main' into feat-navbar
hetd54 a4018a3
style: colors of body to match existing site
hetd54 90f4cfd
refactor: use logos from main
hetd54 34c797d
feat: navbar with main routes
hetd54 71157ed
chore: add back in default tailwind colors too
hetd54 df11be3
chore: add headlessui and heroicons
hetd54 6b9d3bd
feat: add section for mobile-styled links
hetd54 9b02fa6
style: make text larger
hetd54 5923c36
feat: tailwindui styled navbar
hetd54 9b59a9b
style: searchbar columns when it is too crowded
hetd54 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 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 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 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 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,55 @@ | ||
"use client" | ||
import Link from "next/link" | ||
import { usePathname } from "next/navigation" | ||
import { DisclosureButton } from "@headlessui/react" | ||
import React from "react" | ||
|
||
interface NavLinksProps { | ||
linkType?: string | ||
} | ||
|
||
const NavLinks: React.FC<NavLinksProps> = ({ linkType }) => { | ||
const paths = [ | ||
{ slug: "/services", title: "Services" }, | ||
{ slug: "/our-work", title: "Our Work" }, | ||
{ slug: "/help", title: "Help" }, | ||
{ slug: "/about", title: "About" }, | ||
{ slug: "/blog", title: "Blog" }, | ||
] | ||
const pathname = usePathname() | ||
if (linkType === "mobile") { | ||
//block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-600 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 | ||
return ( | ||
<> | ||
{paths.map((path) => { | ||
return ( | ||
<DisclosureButton | ||
key={path.slug} | ||
as="a" | ||
href={path.slug} | ||
className={`block border-l-4 font-medium py-2 pl-3 pr-4 hover:border-gray-300 hover:text-secondary-blue-500 ${pathname === path.slug ? "active text-secondary-blue-500 border-secondary-blue-500" : "border-transparent text-neutral-700"}`} | ||
> | ||
{path.title} | ||
</DisclosureButton> | ||
) | ||
})} | ||
</> | ||
) | ||
} | ||
return ( | ||
<> | ||
{paths.map((path) => { | ||
return ( | ||
<Link | ||
key={path.slug} | ||
className={`inline-flex items-center border-b-2 px-1 pt-1 font-medium hover:border-gray-300 hover:text-secondary-blue-500 ${pathname === path.slug ? "active text-secondary-blue-500 border-b-2 border-secondary-blue-500" : "border-transparent text-neutral-700"}`} | ||
href={path.slug} | ||
> | ||
{path.title} | ||
</Link> | ||
) | ||
})} | ||
</> | ||
) | ||
} | ||
export default NavLinks |
This file contains 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,100 @@ | ||
import LogoCcv from "@/components/assets/LogoCcv" | ||
import LogoBrown from "@/components/assets/LogoBrown" | ||
import NavLinks from "@/components/NavLinks" | ||
|
||
import { | ||
Disclosure, | ||
DisclosureButton, | ||
DisclosurePanel, | ||
} from "@headlessui/react" | ||
import { | ||
MagnifyingGlassIcon, | ||
DocumentTextIcon, | ||
} from "@heroicons/react/20/solid" | ||
import { Bars3Icon, XMarkIcon } from "@heroicons/react/24/outline" | ||
import Link from "next/link" | ||
|
||
const Navbar = () => { | ||
return ( | ||
<Disclosure as="nav" className="bg-neutral-50 shadow"> | ||
<div className="mx-auto max-w-7xl p-2 sm:px-4 lg:px-8"> | ||
<div className="flex flex-col gap-3.5 xl:flex-row xl:h-16 xl:justify-between"> | ||
<div className="flex justify-between px-2 lg:px-0"> | ||
<div className="flex flex-shrink-0 items-center gap-3"> | ||
<a href="https://it.brown.edu/" target="_blank"> | ||
<span className="sr-only">Brown IT Website</span> | ||
<LogoBrown width={115} /> | ||
</a> | ||
<Link href="/"> | ||
<span className="sr-only">Home</span> | ||
<LogoCcv width={105} /> | ||
</Link> | ||
</div> | ||
<div className="hidden lg:ml-6 lg:flex lg:items-center lg:space-x-8"> | ||
<NavLinks /> | ||
</div> | ||
<div className="flex items-center lg:hidden"> | ||
{/* Mobile menu button */} | ||
<DisclosureButton className="group relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500"> | ||
<span className="absolute -inset-0.5" /> | ||
<span className="sr-only">Open main menu</span> | ||
<Bars3Icon | ||
aria-hidden="true" | ||
className="block h-6 w-6 group-data-[open]:hidden" | ||
/> | ||
<XMarkIcon | ||
aria-hidden="true" | ||
className="hidden h-6 w-6 group-data-[open]:block" | ||
/> | ||
</DisclosureButton> | ||
</div> | ||
</div> | ||
<div className="flex flex-1 items-center justify-center px-2 gap-10 lg:ml-6"> | ||
<div> | ||
<a | ||
href="https://docs.ccv.brown.edu" | ||
target="_blank" | ||
aria-label="CCV Services' Documentation" | ||
className="bg-white text-secondary-blue-700 inline-flex items-center rounded-md px-3 py-2 " | ||
> | ||
Docs | ||
<DocumentTextIcon | ||
aria-hidden="true" | ||
className="h-5 w-5 text-secondary-blue-700" | ||
/> | ||
</a> | ||
</div> | ||
|
||
<div className="w-full max-w-lg lg:max-w-xs"> | ||
<label htmlFor="search" className="sr-only"> | ||
Search | ||
</label> | ||
<div className="relative"> | ||
<div className="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"> | ||
<MagnifyingGlassIcon | ||
aria-hidden="true" | ||
className="h-5 w-5 text-gray-400" | ||
/> | ||
</div> | ||
<input | ||
id="search" | ||
name="search" | ||
type="search" | ||
placeholder="Search" | ||
className="block w-full rounded-md border-0 bg-white py-1.5 pl-10 pr-3 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<DisclosurePanel className="lg:hidden"> | ||
<div className="space-y-1 pb-3 pt-2"> | ||
<NavLinks linkType="mobile" /> | ||
</div> | ||
</DisclosurePanel> | ||
</Disclosure> | ||
) | ||
} | ||
export default Navbar |
This file contains 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 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
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.
delete?