Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat(navbar): add hamberger icon for mobile, and dividers
Browse files Browse the repository at this point in the history
  • Loading branch information
kumikokashii committed Jun 24, 2020
1 parent b3f0241 commit 1cf6575
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ const Navbar = () => {
history.push(location)
}

const dividerAboveLabels = [
'patients.newPatient',
'scheduling.appointments.new',
'labs.requests.new',
'incidents.reports.new',
'settings.label',
]

function getDropdownListOfPages(pages: Page[]) {
return pages
.filter((page) => !page.permission || permissions.includes(page.permission))
Expand All @@ -27,6 +35,7 @@ const Navbar = () => {
onClick: () => {
navigateTo(page.path)
},
dividerAbove: dividerAboveLabels.indexOf(page.label) > -1,
}))
}

Expand All @@ -42,9 +51,11 @@ const Navbar = () => {
variant="dark"
navItems={[
{
name: 'menu',
size: 'lg',
type: 'link-list-icon',
children: getDropdownListOfPages(hambergerPages),
label: '',
type: 'link-list',
className: 'nav-hamberger pr-4 d-md-none',
},
{
Expand Down

0 comments on commit 1cf6575

Please sign in to comment.