AlertDialog
An AlertDialog is used to confirm an action that is potentially unsafe.
| Install | yarn add @diallink-corp/convergo-react-dialog |
|---|---|
| Version | 4.1.2 |
| Usage | import {AlertDialog} from '@diallink-corp/convergo-react-dialog' |
Example
<DialogTrigger>
<Button>Proceed</Button>
{(close) => (
<AlertDialog
variant="destructive"
title="Confirm deletion"
actions={[
{
type: 'primary',
label: 'Delete',
onPress: () => window.alert('delete')
},
{
type: 'cancel',
label: 'Cancel',
onPress: () => window.alert('delete')
}
]}
>
Are you sure you would like to delete this entity?
</AlertDialog>
)}
</DialogTrigger>
<DialogTrigger>
<Button>Proceed</Button>
{(close) => (
<AlertDialog
variant="destructive"
title="Confirm deletion"
actions={[
{
type: 'primary',
label: 'Delete',
onPress: () => window.alert('delete')
},
{
type: 'cancel',
label: 'Cancel',
onPress: () => window.alert('delete')
}
]}
>
Are you sure you would like to delete this entity?
</AlertDialog>
)}
</DialogTrigger>
<DialogTrigger>
<Button>
Proceed
</Button>
{(close) => (
<AlertDialog
variant="destructive"
title="Confirm deletion"
actions={[
{
type:
'primary',
label:
'Delete',
onPress:
() =>
window
.alert(
'delete'
)
},
{
type:
'cancel',
label:
'Cancel',
onPress:
() =>
window
.alert(
'delete'
)
}
]}
>
Are you sure you
would like to
delete this
entity?
</AlertDialog>
)}
</DialogTrigger>