-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9175 from carrillo-erik/refactor/M3-6063
refactor: [M3-6063] - Refactor components to use TypeToConfirmDialog component
- Loading branch information
Showing
15 changed files
with
242 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Changed | ||
--- | ||
|
||
Refactor components to use TypeToConfirmDialog ([#9175](https://github.com/linode/manager/pull/9175)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
packages/manager/src/components/TypeToConfirmDialog/TypeToConfirmDialog.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { TypeToConfirmDialog } from './TypeToConfirmDialog'; | ||
|
||
const meta: Meta<typeof TypeToConfirmDialog> = { | ||
title: 'Components/TypeToConfirmDialog', | ||
component: TypeToConfirmDialog, | ||
argTypes: { | ||
children: { | ||
description: 'The items of the Dialog, passed-in as sub-components.', | ||
}, | ||
error: { description: 'Error that will be shown in the dialog.' }, | ||
onClose: { | ||
action: 'onClose', | ||
description: 'Callback fired when the component requests to be closed.', | ||
}, | ||
onClick: { | ||
description: 'Callback fired when the action is confirmed.', | ||
}, | ||
open: { description: 'Is the modal open?' }, | ||
title: { description: 'Title that appears in the heading of the dialog.' }, | ||
}, | ||
args: { | ||
open: true, | ||
title: 'Delete Linode?', | ||
onClose: action('onClose'), | ||
onClick: action('onDelete'), | ||
loading: false, | ||
label: 'Linode Label', | ||
children: '', | ||
error: undefined, | ||
entity: { | ||
type: 'Linode', | ||
action: 'deletion', | ||
name: 'test linode', | ||
primaryBtnText: 'Delete', | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof TypeToConfirmDialog>; | ||
|
||
export const Default: Story = { | ||
render: (args) => ( | ||
<TypeToConfirmDialog {...args}>{args.children}</TypeToConfirmDialog> | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.