featureTourModal.stories.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import React from 'react';
  2. import {withInfo} from '@storybook/addon-info';
  3. import {action} from '@storybook/addon-actions';
  4. import Button from 'app/components/button';
  5. import {IconEdit} from 'app/icons';
  6. import GlobalModal from 'app/components/globalModal';
  7. import FeatureTourModal from 'app/components/modals/featureTourModal';
  8. export default {
  9. title: 'UI/Modals',
  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 = withInfo('A feature tour with multiple steps')(
  32. () => (
  33. <div className="section">
  34. <GlobalModal />
  35. <FeatureTourModal
  36. steps={steps}
  37. onAdvance={action('onAdvance')}
  38. onCloseModal={action('onCloseModal')}
  39. >
  40. {({showModal}) => <Button onClick={showModal}>Show tour</Button>}
  41. </FeatureTourModal>
  42. </div>
  43. )
  44. );
  45. FeatureTourModalBasics.story = {
  46. name: 'FeatureTourModal',
  47. };