Skip to content

Commit

Permalink
convert nav-item from a button to a link
Browse files Browse the repository at this point in the history
  • Loading branch information
troypoulter committed Apr 15, 2024
1 parent fa97239 commit b0c4825
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ Follow their fantastic [Quickstart guide](https://docs.turso.tech/quickstart) an

Start by reading their [CLI installation](https://docs.turso.tech/cli/installation) guide, then their [Local development - Turso CLI](https://docs.turso.tech/local-development#turso-cli) for the most up-to-date approach on setting it up!

### Apply db changes

```bash
npm run db:push
```

### Start the server

```bash
Expand Down
8 changes: 4 additions & 4 deletions src/app/_components/sidebar-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { cn } from "@/lib/utils";
import { set } from "date-fns";
import { LucideIcon } from "lucide-react";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { Dispatch, SetStateAction } from "react";

Expand All @@ -28,16 +29,15 @@ export const SidebarItem = ({
pathname?.startsWith(`${href}/`);

const onClick = () => {
router.push(href);
if (setOpen) {
setOpen(false);
}
};

return (
<button
<Link
onClick={onClick}
type="button"
href={href}
className={cn(
"flex items-center gap-x-2 text-slate-500 text-sm pl-6 md:p-4 rounded-lg transition-all hover:bg-muted",
isActive && "bg-muted font-medium text-primary"
Expand All @@ -53,6 +53,6 @@ export const SidebarItem = ({
/>
{label}
</div>
</button>
</Link>
);
};

0 comments on commit b0c4825

Please sign in to comment.