-
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: menu for hidden nav items #77
Open
seandreassen
wants to merge
5
commits into
dev
Choose a base branch
from
create-menu-for-hidden-nav-items
base: dev
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 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cde6e74
feat: add navigation to all pages
seandreassen 4666650
fix: align vertical links to the left
seandreassen 8c3ef66
feat: add matrix link in header
seandreassen 21d3599
fix: move nav outside ul and fix dropdown styling
seandreassen 5fbe74f
fix: fix aria labels and secondary nav vertical separator
seandreassen 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
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,60 @@ | ||
'use client'; | ||
|
||
import { SecondaryNav } from '@/components/layout/header/SecondaryNav'; | ||
import { Button } from '@/components/ui/Button'; | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuTrigger, | ||
} from '@/components/ui/DropdownMenu'; | ||
import { useMediaQuery } from '@/lib/hooks/useMediaQuery'; | ||
import { EllipsisIcon } from 'lucide-react'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
type DesktopNavMenuProps = { | ||
className?: string; | ||
t: { | ||
open: string; | ||
close: string; | ||
storage: string; | ||
shiftSchedule: string; | ||
}; | ||
}; | ||
|
||
function DesktopNavMenu({ t }: DesktopNavMenuProps) { | ||
const [open, setOpen] = useState(false); | ||
const visible = useMediaQuery('(min-width: 48rem)'); | ||
|
||
useEffect(() => { | ||
if (!visible) { | ||
setOpen(false); | ||
} | ||
}, [visible]); | ||
|
||
return ( | ||
<DropdownMenu open={open} onOpenChange={setOpen}> | ||
<DropdownMenuTrigger asChild> | ||
<Button | ||
className='h-fit' | ||
variant='nav' | ||
size='none' | ||
aria-label={open ? t.close : t.open} | ||
> | ||
<EllipsisIcon aria-hidden /> | ||
seandreassen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</Button> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent className='hidden min-w-[6rem] md:flex' align='end'> | ||
<SecondaryNav | ||
asDropDown | ||
onClick={() => setOpen(false)} | ||
t={{ | ||
storage: t.storage, | ||
seandreassen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
shiftSchedule: t.shiftSchedule, | ||
}} | ||
/> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
); | ||
} | ||
|
||
export { DesktopNavMenu }; |
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,18 @@ | ||
import { Button } from '@/components/ui/Button'; | ||
import { MessageSquareMoreIcon } from 'lucide-react'; | ||
import { useTranslations } from 'next-intl'; | ||
import Link from 'next/link'; | ||
|
||
function MatrixButton() { | ||
const t = useTranslations('layout'); | ||
|
||
return ( | ||
<Button variant='ghost' size='icon' asChild> | ||
<Link href='/' title={t('matrix')}> | ||
seandreassen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<MessageSquareMoreIcon className='h-[1.2rem] w-[1.2rem]' aria-hidden /> | ||
</Link> | ||
</Button> | ||
); | ||
} | ||
|
||
export { MatrixButton }; |
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.
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.
This is unrelated to this issue but the 'ui' namespaces is available in all client components so when we use from it we dont have to pass it as a prop we can use useTranslations('ui') within the client component