confirm.stories.js 716 B

1234567891011121314151617181920212223242526272829303132
  1. import React from 'react';
  2. import Button from 'app/components/button';
  3. import Confirm from 'app/components/confirm';
  4. // TODO(scttcper): modal not working
  5. export default {
  6. title: 'Core/Buttons/Confirm',
  7. component: Confirm,
  8. args: {
  9. message: 'Are you sure you want to do this?',
  10. },
  11. argTypes: {
  12. onConfirm: {action: 'confirmed'},
  13. },
  14. };
  15. export const _Confirm = ({...args}) => (
  16. <div>
  17. <Confirm {...args}>
  18. <Button priority="primary">Confirm on Button click</Button>
  19. </Confirm>
  20. </div>
  21. );
  22. _Confirm.parameters = {
  23. docs: {
  24. description: {
  25. story:
  26. 'Component whose child is rendered as the "action" component that when clicked opens the "Confirm Modal"',
  27. },
  28. },
  29. };