Skip to content

Commit

Permalink
fix(modal): Update old delete button references in modal stories
Browse files Browse the repository at this point in the history
  • Loading branch information
anicholls committed Mar 9, 2020
1 parent ce33cff commit 74ac320
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions modules/modal/react/stories/stories.tsx
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import {storiesOf} from '@storybook/react';
import withReadme from 'storybook-readme/with-readme';

import {Button} from '../../../button/react';
import {Button, DeleteButton} from '../../../button/react';
import Modal, {useModal} from '..';
import README from '../README.md';

Expand All @@ -22,14 +22,14 @@ const DefaultModalExample = () => {

return (
<>
<Button variant={Button.Variant.Delete} buttonRef={buttonRef} onClick={openModal}>
<DeleteButton buttonRef={buttonRef} onClick={openModal}>
Delete Item
</Button>
</DeleteButton>
<Modal data-testid="TestModal" heading="Delete Item" open={open} handleClose={closeModal}>
<p>Are you sure you'd like to delete the item titled 'My Item'?</p>
<Button style={{marginRight: '16px'}} onClick={closeModal} variant={Button.Variant.Delete}>
<DeleteButton style={{marginRight: '16px'}} onClick={closeModal}>
Delete
</Button>
</DeleteButton>
<Button onClick={closeModal} variant={Button.Variant.Secondary}>
Cancel
</Button>
Expand All @@ -43,14 +43,12 @@ const UseModalExample = () => {

return (
<>
<Button variant={Button.Variant.Delete} {...targetProps}>
Delete Item
</Button>
<DeleteButton {...targetProps}>Delete Item</DeleteButton>
<Modal data-testid="TestModal" heading={'Delete Item'} {...modalProps}>
<p>Are you sure you'd like to delete the item titled 'My Item'?</p>
<Button style={{marginRight: '16px'}} onClick={closeModal} variant={Button.Variant.Delete}>
<DeleteButton style={{marginRight: '16px'}} onClick={closeModal}>
Delete
</Button>
</DeleteButton>
<Button onClick={closeModal} variant={Button.Variant.Secondary}>
Cancel
</Button>
Expand All @@ -64,19 +62,17 @@ const NoCloseModalExample = () => {

return (
<>
<Button variant={Button.Variant.Delete} {...targetProps}>
Delete Item
</Button>
<DeleteButton {...targetProps}>Delete Item</DeleteButton>
<Modal
data-testid="TestModal"
heading={'Delete Item'}
{...modalProps}
handleClose={undefined}
>
<p>Are you sure you'd like to delete the item titled 'My Item'?</p>
<Button style={{marginRight: '16px'}} onClick={closeModal} variant={Button.Variant.Delete}>
<DeleteButton style={{marginRight: '16px'}} onClick={closeModal}>
Delete
</Button>
</DeleteButton>
<Button onClick={closeModal} variant={Button.Variant.Secondary}>
Cancel
</Button>
Expand All @@ -91,9 +87,7 @@ const CustomFocusModalExample = () => {

return (
<>
<Button variant={Button.Variant.Delete} {...targetProps}>
Delete Item
</Button>
<DeleteButton {...targetProps}>Delete Item</DeleteButton>
<Modal
data-testid="TestModal"
heading={'Delete Item'}
Expand All @@ -102,9 +96,9 @@ const CustomFocusModalExample = () => {
handleClose={undefined}
>
<p>Are you sure you'd like to delete the item titled 'My Item'?</p>
<Button style={{marginRight: '16px'}} onClick={closeModal} variant={Button.Variant.Delete}>
<DeleteButton style={{marginRight: '16px'}} onClick={closeModal}>
Delete
</Button>
</DeleteButton>
<Button onClick={closeModal} variant={Button.Variant.Secondary} buttonRef={buttonRef}>
Cancel
</Button>
Expand Down

0 comments on commit 74ac320

Please sign in to comment.