featureTourModal.stories.js 1.4 KB

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