import {Fragment} from 'react'; import {Button} from 'sentry/components/button'; import ButtonBar from 'sentry/components/buttonBar'; import {CodeSnippet} from 'sentry/components/codeSnippet'; import {IconAdd, IconCopy, IconSubtract} from 'sentry/icons'; import storyBook from 'sentry/stories/storyBook'; import {SectionKey} from 'sentry/views/issueDetails/streamline/context'; import {FoldSection} from 'sentry/views/issueDetails/streamline/foldSection'; export default storyBook('FoldSection', story => { story('Usage', () => ( {`import {SectionKey} from 'sentry/views/issueDetails/streamline/context'; import {FoldSection} from 'sentry/views/issueDetails/streamline/foldSection'; `}

The SectionKey required in props is used to create a local storage state key to remember the user's previous state for the fold section.

)); story('Default example', () => { return ( {`

Lorem ipsum...

`}
); }); story('Preventing user from collapsing the section', () => { return ( {`

Lorem ipsum...

`}
); }); story('Custom headers/titles for the section', () => { return ( Custom Title} sectionKey={SectionKey.HIGHLIGHTS} > } sectionKey={SectionKey.HIGHLIGHTS} > {`} actions={} sectionKey={SectionKey.MY_SECTION}>

Lorem ipsum...

`}
); }); story('Collapsing the section by default', () => { return (

Important Note: User's local storage preferences overwrite this prop, if they have manually opened this section before, it will stay open and ignore this prop.

{`

Lorem ipsum...

`}
); }); }); function Lorem() { return (

Lorem ipsum dolor sit amet consectetur adipisicing elit. Corrupti expedita unde exercitationem tempora non recusandae sapiente aspernatur, culpa perferendis illum? Facere cupiditate soluta eligendi aliquam labore ratione corrupti inventore delectus.

Lorem ipsum dolor sit amet consectetur adipisicing elit. Recusandae suscipit nihil eaque earum minus, optio officia, nam nemo error harum, cupiditate cum odio debitis rerum quod maiores ipsa quia nobis? Lorem, ipsum dolor sit amet consectetur adipisicing elit. Dignissimos, similique reiciendis aliquid eius corrupti eum magni in dolores deleniti sequi maxime assumenda numquam blanditiis magnam fuga quo tempore ipsum ducimus! Lorem ipsum dolor sit amet consectetur adipisicing elit. Repellendus tempore optio architecto, dignissimos assumenda quasi reiciendis in earum hic quae quidem deserunt dolorum aut, sint impedit distinctio totam. Ullam, veniam?

); }