featureTourModal.stories.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import {action} from '@storybook/addon-actions';
  2. import Button from 'sentry/components/button';
  3. import GlobalModal from 'sentry/components/globalModal';
  4. import FeatureTourModal from 'sentry/components/modals/featureTourModal';
  5. import {IconEdit} from 'sentry/icons';
  6. export default {
  7. title: 'Views/Modals/Feature Tour Modal',
  8. component: FeatureTourModal,
  9. };
  10. const steps = [
  11. {
  12. title: 'How to draw an owl',
  13. body: <p>First get all your sketchbook and pencil.</p>,
  14. },
  15. {
  16. title: 'Draw two circles',
  17. body: 'Next, draw a circle for the head, and another for the body.',
  18. actions: <Button>Read docs</Button>,
  19. },
  20. {
  21. image: <IconEdit size="xl" />,
  22. title: 'Draw the rest of the owl',
  23. body: 'Finish off the drawing by adding eyes, feathers and talons.',
  24. },
  25. {
  26. title: 'All done!',
  27. body: 'Great job on drawing your owl.',
  28. },
  29. ];
  30. export const FeatureTourModalBasics = () => (
  31. <div className="section">
  32. <GlobalModal />
  33. <FeatureTourModal
  34. steps={steps}
  35. onAdvance={action('onAdvance')}
  36. onCloseModal={action('onCloseModal')}
  37. >
  38. {({showModal}) => <Button onClick={showModal}>Show tour</Button>}
  39. </FeatureTourModal>
  40. </div>
  41. );
  42. FeatureTourModalBasics.storyName = 'Feature Tour Modal';
  43. FeatureTourModalBasics.parameters = {
  44. docs: {
  45. description: {
  46. story: 'A feature tour with multiple steps',
  47. },
  48. },
  49. };