Download wp-calypso/packages/components/src/dialog/index.stories.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 497 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/components/src/dialog/index.stories.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/components/src/dialog/index.stories.jsx
-
curl -L -o index.stories.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/components/src/dialog/index.stories.jsx
497 Bytes
| import { useState } from 'react'; | |
| import Dialog from '.'; | |
| export default { title: 'Unaudited/Dialog' }; | |
| export const Default = () => { | |
| const [ isVisible, setVisible ] = useState( false ); | |
| const handleShowDialog = () => setVisible( true ); | |
| const handleHideDialog = () => setVisible( false ); | |
| return ( | |
| <> | |
| <button onClick={ handleShowDialog }>Open Dialog</button> | |
| <Dialog isVisible={ isVisible } onClose={ handleHideDialog } shouldCloseOnEsc> | |
| Hello World! | |
| </Dialog> | |
| </> | |
| ); | |
| }; | |