-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add breadcrumbs to UI for easy navigation
- Loading branch information
Showing
4 changed files
with
8,496 additions
and
6,886 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 |
---|---|---|
@@ -1,3 +1,33 @@ | ||
"use client"; | ||
import {getToolByHref} from "@/config/tools"; | ||
import BuildCircleRoundedIcon from "@mui/icons-material/BuildCircleRounded"; | ||
import GridViewRoundedIcon from "@mui/icons-material/GridViewRounded"; | ||
import HomeRoundedIcon from "@mui/icons-material/HomeRounded"; | ||
import {BreadcrumbItem, Breadcrumbs} from "@nextui-org/react"; | ||
import {usePathname, useRouter} from "next/navigation"; | ||
export default function ToolLayout({children}: {children: React.ReactNode}) { | ||
return <main className="h-screen overflow-auto px-2">{children} </main>; | ||
const path = usePathname(); | ||
const tool = getToolByHref(path); | ||
const router = useRouter(); | ||
|
||
return ( | ||
<main className="h-screen overflow-auto px-2"> | ||
<Breadcrumbs className="flex justify-center mt-4"> | ||
<BreadcrumbItem | ||
onPress={() => router.push("/")} | ||
startContent={<HomeRoundedIcon fontSize="small" />} | ||
> | ||
Home | ||
</BreadcrumbItem> | ||
{/* TODO: route to tools page */} | ||
<BreadcrumbItem startContent={<GridViewRoundedIcon fontSize="small" />}> | ||
Tools | ||
</BreadcrumbItem> | ||
<BreadcrumbItem startContent={<BuildCircleRoundedIcon fontSize="small" />}> | ||
{tool?.title} | ||
</BreadcrumbItem> | ||
</Breadcrumbs> | ||
{children} | ||
</main> | ||
); | ||
} |
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.