import React from 'react'; import {storiesOf} from '@storybook/react'; import {Modal, BackdropModal} from 'display-library/Modal'; const ModalStory: React.FC = () => { const [isOpen, setOpen] = React.useState(false); const [isModalOverflowing, setModalOverflowing] = React.useState(false); const handleClose = React.useCallback((): void => setOpen(false), []); const handleToggleOverflow = React.useCallback( (): void => setModalOverflowing(prevValue => !prevValue), [] ); return ( <> {isOpen && ( This content is in the modal. Press <esc>{' '} to close. Note that body scroll becomes locked. {isModalOverflowing && new Array(100) .fill(undefined) .map((_, i) =>

Overflow to make modal scrollable

)}
)} {new Array(100).fill(undefined).map((_, i) => (

Overflow to make body scrollable

))} ); }; const BackdropModalStory: React.FC = () => { const [isOpen, setOpen] = React.useState(false); const handleClose = React.useCallback((): void => setOpen(false), []); return ( <> {isOpen && (
{/* Don't actually style things like this obviously */}

What is Trunkshow?

Trunkshows showcase next-season’s collection. Since you’re ordering in advance, producing your piece will take several months.

Pay half now, half when it ships. If it’s not quite what you were looking for, returns are free.

)} ); }; storiesOf('Modal', module) .add('Modal', () => ) .add('BackdropModal', () => );