Skip to content

Commit a7487fe

Browse files
committed
fix: fix search command
1 parent 4e66f89 commit a7487fe

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

www/next.config.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const config = {
1616
},
1717
],
1818
},
19-
transpilePackages: ["jotai-devtools"],
2019
};
2120

2221
export default withMDX(config);

www/src/components/search-command.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
Loader2Icon,
1313
SearchIcon,
1414
TextIcon,
15-
Undo2Icon,
1615
} from "lucide-react";
1716
import { kekabCaseToTitle } from "@/lib/string";
1817
import { useCommandMenuInputRef } from "@/hooks/use-focus-command-menu";
@@ -71,7 +70,7 @@ export const SearchCommand = ({
7170
const { setInputRef } = useCommandMenuInputRef();
7271

7372
React.useEffect(() => {
74-
if (context) setInputRef(inputRef);
73+
if (context && inputRef.current) setInputRef(inputRef);
7574
}, [context, setInputRef]);
7675

7776
return (

www/src/config/site-config.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export const siteConfig = {
2929
export const searchConfig = {
3030
defaultResults: [
3131
{ name: "Installation", href: "/docs/getting-started/installation" },
32+
{ name: "Themes", href: "/themes" },
3233
{ name: "Button", href: "/docs/components/buttons/button" },
3334
{ name: "TextField", href: "/docs/components/inputs/text-field" },
34-
{ name: "Menu", href: "/docs/components/menus-and-selection/menu" },
3535
],
3636
};

www/src/hooks/use-focus-command-menu.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { RefObject } from "react";
22
import { create } from "zustand";
33

44
type FocusCommandMenuStore = {
5-
inputRef: RefObject<HTMLInputElement> | null;
6-
setInputRef: (ref: RefObject<HTMLInputElement>) => void;
5+
inputRef: RefObject<HTMLInputElement | null> | null;
6+
setInputRef: (ref: RefObject<HTMLInputElement | null>) => void;
77
focusInput: () => void;
88
};
99

0 commit comments

Comments
 (0)