/* eslint-disable react/prop-types */ import 'twin.macro'; import { useArgs } from '@storybook/client-api'; import React from 'react'; import Drawer from '~/layout/Drawer'; export default { title: 'Layout/Drawer', component: Drawer, args: { isOpen: true, }, argTypes: { isOpen: { control: { type: 'boolean', }, }, }, }; export function RightDrawer(props) { const [_, updateArgs] = useArgs(); const onClose = () => updateArgs({ ...props, isOpen: false }); return ( <>

Use the Storybook isOpen control to toggle the drawer

The drawer should emerge from the right of the screen

Drawer Content

Click the underlay to dismiss the drawer

); } export function LeftDrawer(props) { const [_, updateArgs] = useArgs(); const onClose = () => updateArgs({ ...props, isOpen: false }); return ( <>

Use the Storybook isOpen control to toggle the drawer.

The drawer should emerge from the left of the screen

Drawer Content

Click the underlay to dismiss the drawer

); }