Skip to content

Commit

Permalink
Merge pull request #556 from MH4GF/add-about-to-command
Browse files Browse the repository at this point in the history
feat: add "About me" link to Command component for non-homepage navigation
  • Loading branch information
MH4GF authored Dec 22, 2024
2 parents 3401d92 + a28d2a1 commit 95c84c3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/_features/command/Command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
CommandList,
CommandSeparator,
} from "@/app/_components/ui/command";
import { PenLine } from "lucide-react";
import { PenLine, UserRound } from "lucide-react";
import { usePathname } from "next/navigation";
import { useEffect, useState } from "react";
import { CommandFooter } from "./CommandFooter";
import { CommandProvider } from "./CommandProvider";
Expand All @@ -18,6 +19,7 @@ import { ShareToX } from "./items/ShareToX";

export function Command() {
const [open, setOpen] = useState(false);
const pathname = usePathname();

useEffect(() => {
const down = (e: KeyboardEvent) => {
Expand All @@ -43,6 +45,12 @@ export function Command() {
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Contents">
{pathname !== "/" && (
<CommandLinkItem href="/">
<UserRound className="mr-2 h-4 w-4" />
<span>About me</span>
</CommandLinkItem>
)}
<CommandLinkItem href="/articles">
<PenLine className="mr-2 h-4 w-4" />
<span>All Writing</span>
Expand Down

0 comments on commit 95c84c3

Please sign in to comment.