forked from raystack/apsara
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(drawer): close on overlay click (#36)
- Loading branch information
1 parent
ec7457d
commit 6565493
Showing
5 changed files
with
44 additions
and
58 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
import { useState } from 'react'; | ||
import Drawer from './Drawer'; | ||
|
||
export const Basic = () => { | ||
const [open, setOpen] = useState(false); | ||
return ( | ||
<> | ||
<button type="button" onClick={() => setOpen(true)}>Click to open Drawer</button> | ||
<Drawer | ||
open={open} | ||
onClose={() => setOpen(false)} | ||
> | ||
<p>This is sample drawer content</p> | ||
<button type="button" onClick={() => console.log('test')}>Test</button> | ||
</Drawer> | ||
</> | ||
); | ||
} | ||
|
||
export default { | ||
title: "Overlay/Drawer", | ||
component: Drawer, | ||
}; |
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
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