AlertDialog

An AlertDialog is used to confirm an action that is potentially unsafe.

Installyarn add @diallink-corp/convergo-react-dialog
Version4.1.2
Usageimport {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>