Skip to content

Commit

Permalink
Initial support for breadcrumbs
Browse files Browse the repository at this point in the history
feat: add breadcrumbs to UI for easy navigation
  • Loading branch information
a0v0 authored Apr 26, 2024
2 parents 2c54a10 + 7cf062d commit 719688a
Show file tree
Hide file tree
Showing 4 changed files with 8,496 additions and 6,886 deletions.
10 changes: 9 additions & 1 deletion TODO.md → NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<!-- TODO: add seo -->
## To Do

- TODO: add seo

## Checkpoints for new tool

- [ ] Logic
- [ ] Breadcumbs

<!-- wasm notes -->

```
Expand Down
32 changes: 31 additions & 1 deletion app/tools/layout.tsx
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>
);
}
2 changes: 1 addition & 1 deletion components/primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const title = tv({
size: {
xs: "text-1xl lg:text-1xl",
sm: "text-2xl lg:text-4xl",
md: "text-[2.1rem] lg:text-5xl",
md: "text-[2.1rem] lg:text-5xl lg:leading-tight ",
lg: "text-3xl lg:text-6xl",
},
fullWidth: {
Expand Down
Loading

0 comments on commit 719688a

Please sign in to comment.