www: rework docs layout (#2429)
- Re-enable partials - clean up layout a bit
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
},
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
},
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
// islands/Dropdown.tsx
|
||||
import { ComponentChildren, createContext } from "preact";
|
||||
import { StateUpdater, useState } from "preact/hooks";
|
||||
import { useState } from "preact/hooks";
|
||||
|
||||
const DropdownContext = createContext<[boolean, StateUpdater<boolean>]>(
|
||||
[false, () => {}],
|
||||
const DropdownContext = createContext<[boolean, (prev: boolean) => boolean]>(
|
||||
[false, () => false],
|
||||
);
|
||||
|
||||
export default function Dropdown(
|
||||
{ children }: { children: ComponentChildren },
|
||||
) {
|
||||
return (
|
||||
<DropdownContext.Provider value={useState(false)}>
|
||||
// deno-lint-ignore no-explicit-any
|
||||
<DropdownContext.Provider value={useState(false) as any}>
|
||||
{children}
|
||||
</DropdownContext.Provider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user