-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(saas): Mobile responsive app sidenav
- Loading branch information
1 parent
9f1df73
commit 358da4f
Showing
7 changed files
with
99 additions
and
17 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { MobileSidenav } from "@/app/(app)/_components/mobile-sidenav"; | ||
import { Icons } from "@/components/ui/icons"; | ||
|
||
type AppHeaderProps = { | ||
sidebarNavIncludeIds?: string[]; | ||
sidebarNavRemoveIds?: string[]; | ||
showOrgSwitcher?: boolean; | ||
}; | ||
|
||
export function AppHeader({ | ||
sidebarNavIncludeIds, | ||
sidebarNavRemoveIds, | ||
showOrgSwitcher, | ||
}: AppHeaderProps) { | ||
return ( | ||
<header className="sticky top-0 flex h-14 items-center gap-4 border-b border-border bg-background"> | ||
<MobileSidenav | ||
showOrgSwitcher={showOrgSwitcher} | ||
sidebarNavIncludeIds={sidebarNavIncludeIds} | ||
sidebarNavRemoveIds={sidebarNavRemoveIds} | ||
/> | ||
<Icons.logo hideTextOnMobile={false} /> | ||
</header> | ||
); | ||
} |
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
35 changes: 35 additions & 0 deletions
35
starterkits/saas/src/app/(app)/_components/mobile-sidenav.tsx
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,35 @@ | ||
import { Sidebar } from "@/app/(app)/_components/sidebar"; | ||
import { Button } from "@/components/ui/button"; | ||
import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet"; | ||
import { MenuIcon } from "lucide-react"; | ||
|
||
type MobileSideNavProps = { | ||
sidebarNavIncludeIds?: string[]; | ||
sidebarNavRemoveIds?: string[]; | ||
showOrgSwitcher?: boolean; | ||
}; | ||
|
||
export function MobileSidenav({ | ||
showOrgSwitcher, | ||
sidebarNavIncludeIds, | ||
sidebarNavRemoveIds, | ||
}: MobileSideNavProps) { | ||
return ( | ||
<Sheet> | ||
<SheetTrigger asChild> | ||
<Button variant="outline" size="iconSmall"> | ||
<MenuIcon className="h-4 w-4" /> | ||
<p className="sr-only">Open menu</p> | ||
</Button> | ||
</SheetTrigger> | ||
<SheetContent side="left" className="px-3 pb-20 pt-10"> | ||
<Sidebar | ||
showLogo={false} | ||
showOrgSwitcher={showOrgSwitcher} | ||
sidebarNavIncludeIds={sidebarNavIncludeIds} | ||
sidebarNavRemoveIds={sidebarNavRemoveIds} | ||
/> | ||
</SheetContent> | ||
</Sheet> | ||
); | ||
} |
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