Skip to content

Commit bc95498

Browse files
committed
feat: add query param to auto open examples dropdown
1 parent 30e6be8 commit bc95498

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/client/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {
4343
} from "lucide-react";
4444
import { type FC, useEffect, useMemo, useRef, useState } from "react";
4545
import { useDebouncedValue } from "./hooks/debounce";
46+
import { useSearchParams } from "react-router";
4647

4748
export const App = () => {
4849
const [wasmLoadState, setWasmLoadingState] = useState<WasmLoadState>(() => {
@@ -309,8 +310,10 @@ const ShareButton: FC<ShareButtonProps> = ({ code }) => {
309310
};
310311

311312
const ExampleSelector: FC = () => {
313+
const [searchParams] = useSearchParams();
314+
312315
return (
313-
<DropdownMenu>
316+
<DropdownMenu defaultOpen={searchParams.has("examples")}>
314317
<DropdownMenuTrigger className="font-light text-content-secondary text-sm hover:text-content-primary">
315318
Examples
316319
</DropdownMenuTrigger>

0 commit comments

Comments
 (0)