generated from codersforcauses/django-nextjs-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Issue 18 create navbar component #80
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
melbauerr
wants to merge
14
commits into
main
Choose a base branch
from
issue-18-Create_Navbar_component
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
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a820492
added navbar
melbauerr f8d499f
Navbar button styling
melbauerr b155ab0
Mobile view styling
melbauerr 1017d75
Add responsive navbar styling
melbauerr c234df6
mobile view adjustments
melbauerr 05a327f
mobile view adjustments
melbauerr 7d9d137
merge conflicts
MahitGtg af2e312
Merges main branch
melbauerr 76cc6bc
Sticky navbar
melbauerr 3d5d9ca
format page with prettier
melbauerr b2c22fe
ClassName redundant changes
melbauerr e24c4a7
navbar border changed to black
melbauerr 68048b6
navbar adjustments: dropdown and styling
melbauerr a4bd95a
link to find-my-booking page.tsx
melbauerr 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,91 @@ | ||
| "use client"; | ||
|
|
||
| import Image from "next/image"; | ||
| import Link from "next/link"; | ||
| import { useState } from "react"; | ||
| import { HiOutlineUser } from "react-icons/hi"; | ||
|
|
||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| import { Button } from "./button"; | ||
|
|
||
| export default function Navbar() { | ||
| const [open, setOpen] = useState(false); | ||
|
|
||
| return ( | ||
| <nav className="sticky top-0 z-50 w-full border-b-2 border-black bg-white"> | ||
| <div className="max-w-8xl mx-auto flex items-center justify-between px-12 py-3"> | ||
| {/* logo */} | ||
| <Link href="/" className="text-xl font-semibold"> | ||
| <Image src="/logo.png" width={50} height={50} alt="logo" /> | ||
| </Link> | ||
|
|
||
| {/* mobile */} | ||
| <button | ||
| className="flex flex-col items-center justify-center space-y-1 md:hidden" | ||
| onClick={() => setOpen(!open)} | ||
| > | ||
| <span | ||
| className={cn( | ||
| "block h-0.5 w-6 bg-black transition-all", | ||
| open && "translate-y-1.5 rotate-45", | ||
| )} | ||
| /> | ||
| <span | ||
| className={cn( | ||
| "block h-0.5 w-6 bg-black transition-all", | ||
| open && "opacity-0", | ||
| )} | ||
| /> | ||
| <span | ||
| className={cn( | ||
| "block h-0.5 w-6 bg-black transition-all", | ||
| open && "-translate-y-1.5 -rotate-45", | ||
| )} | ||
| /> | ||
| </button> | ||
|
|
||
| {/* desktop */} | ||
| <div className="hidden items-center gap-6 md:flex"> | ||
| <Link href="/"> | ||
| <Button variant="outline">Book room</Button> | ||
| </Link> | ||
| <Link href="/find-my-booking"> | ||
| <Button variant="text">Find my booking</Button> | ||
| </Link> | ||
| <Link href="/admin"> | ||
| <Button variant="login"> | ||
| <HiOutlineUser className="h-5 w-5" /> | ||
| Admin login | ||
| </Button> | ||
| </Link> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* mobile hamburger */} | ||
| {open && ( | ||
| <div className="absolute left-0 top-full max-h-screen w-full overflow-y-auto bg-white md:hidden"> | ||
| <div className="flex h-full flex-col items-end gap-6 px-8 py-6"> | ||
|
Contributor
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.
|
||
| <Link href="/"> | ||
| <Button variant="outline">Book room</Button> | ||
| </Link> | ||
| <Link | ||
| href="/find-my-booking" | ||
| className="-mx-4 mt-4 hover:text-primary" | ||
| > | ||
| <Button variant="text">Find my booking</Button> | ||
| </Link> | ||
| <div className="-mx-2 mt-20"> | ||
| <Link href="/admin"> | ||
| <Button variant="login"> | ||
| <HiOutlineUser className="h-5 w-5" /> | ||
| Admin login | ||
| </Button> | ||
| </Link> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| )} | ||
| </nav> | ||
| ); | ||
| } | ||
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
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.
The hamburger menu button lacks an accessible label. Add an aria-label attribute to describe the button's purpose for screen reader users.