-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
```js // Note: I do not want to have to build an entire drawer component // just to show the playground on documentation pages. For now, // it is much easier to just place the playground at the bottom of // the documentation page. I will revisit this later when I have // more time to work on it. ```
- Loading branch information
1 parent
3ed5cd0
commit b81905a
Showing
2 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { JSX } from "preact/jsx-runtime"; | ||
|
||
export interface DrawerProps { | ||
summary: string; | ||
children: JSX.Element[]; | ||
} | ||
|
||
// Reference: | ||
// https://web.dev/articles/codelab-building-a-sidenav-component | ||
|
||
// Note: I do not want to have to build an entire drawer component | ||
// just to show the playground on documentation pages. For now, | ||
// it is much easier to just place the playground at the bottom of | ||
// the documentation page. I will revisit this later when I have | ||
// more time to work on it. TODO: Remove this comment when done. | ||
|
||
export default function Drawer(props: DrawerProps) { | ||
return ( | ||
<details> | ||
<summary> | ||
<h2>{props.summary}</h2> | ||
</summary> | ||
{props.children} | ||
</details> | ||
); | ||
} |