globalModal.stories.js 821 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import {openModal} from 'sentry/actionCreators/modal';
  2. import Button from 'sentry/components/button';
  3. import GlobalModal from 'sentry/components/globalModal';
  4. export default {
  5. title: 'Views/Modals/Global Modal',
  6. };
  7. export const _GlobalModal = () => (
  8. <div>
  9. <Button
  10. onClick={() =>
  11. openModal(({closeModal, Header, Body}) => (
  12. <div>
  13. <Header>Modal Header</Header>
  14. <Body>
  15. <div>Test Modal Body</div>
  16. <Button onClick={closeModal}>Close</Button>
  17. </Body>
  18. </div>
  19. ))
  20. }
  21. >
  22. Open
  23. </Button>
  24. <GlobalModal />
  25. </div>
  26. );
  27. _GlobalModal.storyName = 'Global Modal';
  28. _GlobalModal.parameters = {
  29. docs: {
  30. description: {
  31. story: 'Call `openModal` action creator to open a modal',
  32. },
  33. },
  34. };