confirm.stories.js 648 B

12345678910111213141516171819202122
  1. import React from 'react';
  2. import {withInfo} from '@storybook/addon-info';
  3. import {action} from '@storybook/addon-actions';
  4. import Confirm from 'app/components/confirm';
  5. import Button from 'app/components/button';
  6. export default {
  7. title: 'UI/Confirm',
  8. };
  9. export const _Confirm = withInfo({
  10. text:
  11. 'Component whose child is rendered as the "action" component that when clicked opens the "Confirm Modal"',
  12. propTablesExclude: [Button],
  13. })(() => (
  14. <div>
  15. <Confirm onConfirm={action('confirmed')} message="Are you sure you want to do this?">
  16. <Button priority="primary">Confirm on Button click</Button>
  17. </Confirm>
  18. </div>
  19. ));