How to use the react-confirm-alert.confirmAlert function in react-confirm-alert

To help you get started, we’ve selected a few react-confirm-alert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airbus-cyber / graylog-plugin-alert-wizard / src / web / wizard / CreateAlertInput.jsx View on Github external
_advancedSettings() {
        const options = {
            title: this.state.messages.titlePopup,
            message: this.state.messages.messagePopup,
            buttons: [
                {
                    label: this.state.messages.advancedSettings,
                    onClick: () => history.push({pathname: Routes.show_alert_condition(this.state.alert.stream.id, this.state.alert.condition)})
                },
                {
                    label: this.state.messages.done,
                    onClick: () => history.push({pathname: Routes.pluginRoute('WIZARD')})
                },
            ]
        };
        confirmAlert(options);
    },
    _updateAlertField(field, value) {
github llambda / agilegps / src / client / components / organizations.js View on Github external
function deleteOrganization(org) {
  confirmAlert({
    title: 'Delete organization',
    message: `Are you sure you want to delete organization ${org.name}?`,
    buttons: [
      {
        label: 'Cancel',
      },
      {
        label: 'Delete',
        onClick: () => {
          deleteOrg(org)
          .then(() => {
            toast.success(`Org ${org.name} deleted.`);
          })
          .catch(err => {
            toast.error(`Failed to delete org ${org.name}: ${err.message}`);
          });
github llambda / agilegps / src / client / components / devices.js View on Github external
function deleteDevice(device) {
  confirmAlert({
    title: 'Delete device',
    message: `Are you sure you want to delete device ${device.imei}?`,
    buttons: [
      {
        label: 'Cancel',
      },
      {
        label: 'Delete',
        onClick: () => {
          appState.deleteDevice(device)
          .then(() => {
            toast.success(`Device ${device.imei} deleted.`);
          })
          .catch(err => {
            toast.error(`Failed to delete user ${device.imei} : ${err.message}`);
          });
github llambda / agilegps / src / client / components / users.js View on Github external
function deleteUser(user) {
  confirmAlert({
    title: 'Delete user',
    message: `Are you sure you want to delete user ${user.username}?`,
    buttons: [
      {
        label: 'Cancel',
      },
      {
        label: 'Delete',
        onClick: () => {
          appState.deleteUser(user)
          .then(() => {
            toast.success(`User ${user.username} deleted.`);
          })
          .catch(err => {
            toast.error(`Failed to delete user ${user.username}: ${err.message}`);
          });
github ItayRosen / OpenIoT / platform / src / components / Thing / Overview.js View on Github external
Delete() {
		confirmAlert({
			title: 'Confirm to Delete',
			message: 'Are you sure you want to delete this Thing? This action cannot be undone!',
			buttons: [
			{
				label: 'Yes',
				onClick: () => {
					this.setState({transmitting: true});
					fetch(API_URL + "thing/delete.php", {credentials: 'include', method: "POST", body: JSON.stringify({"id": this.state.thingID})})
					.then(res => res.json())
					.then(
					   (result) => {
							if (result.response === 200) {
								this.setState({redirect: "/Dashboard"});
							}
							else {
								this.setState({transmitting: false});
github llambda / agilegps / src / client / components / fleets.js View on Github external
function deleteFleet(fleet) {
  confirmAlert({
    title: 'Delete fleet',
    message: `Are you sure you want to delete fleet ${fleet.name}?`,
    buttons: [
      {
        label: 'Cancel',
      },
      {
        label: 'Delete',
        onClick: () => {
          appState.deleteFleet(fleet)
          .then(() => {
            toast.success(`Fleet ${fleet.name} deleted.`);
          })
          .catch(err => {
            toast.error(`Failed to delete fleet ${fleet.name}: ${err.message}`);
          });
github llambda / agilegps / src / client / components / vehicles.js View on Github external
function deleteVehicle(vehicle) {
  confirmAlert({
    title: 'Delete vehicle',
    message: `Are you sure you want to delete vehicle ${vehicle.name}?`,
    buttons: [
      {
        label: 'Cancel',
      },
      {
        label: 'Delete',
        onClick: () => {
          appState.deleteVehicle(vehicle)
          .then(() => {
            toast.success(`Vehicle ${vehicle.name} deleted.`);
          })
          .catch(err => {
            toast.error(`Failed to delete vehicle ${vehicle.name}: ${err.message}`);
          });
github stellasia / neomap / src / components / layers / layer.js View on Github external
showQuery(event) {
	confirmAlert({
	    message: this.getQuery(),
	    buttons: [
		{
		    label: 'OK',
		}
	    ]
	});
	event.preventDefault();
    };

react-confirm-alert

react component confirm dialog.

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis

Popular react-confirm-alert functions