How to use the react-redux-toastr.toastr.confirm function in react-redux-toastr

To help you get started, we’ve selected a few react-redux-toastr 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 keyteki / keyteki / client / GameBoard.jsx View on Github external
onLeaveClick() {
        if(!this.state.spectating && this.isGameActive()) {
            toastr.confirm('Your game is not finished, are you sure you want to leave?', {
                onOk: () => {
                    this.props.sendGameMessage('leavegame');
                    this.props.closeGameSocket();
                }
            });

            return;
        }

        this.props.sendGameMessage('leavegame');
        this.props.closeGameSocket();
    }
github resource-watch / resource-watch / components / areas / AreaCard.js View on Github external
handleDeleteArea = () => {
    const { area } = this.props;
    const toastrConfirmOptions = {
      onOk: () => {
        this.props.removeUserArea(area);
      }
    };
    toastr.confirm(`Are you sure you want to delete the area ${area.name}?
      Deleting an area will delete all the subscriptions associated to it`, toastrConfirmOptions);
  }
github resource-watch / resource-watch / components / widgets / list / WidgetCard.js View on Github external
handleRemoveVisualization = () => {
    const { widget, user, onWidgetRemove } = this.props;
    const { token } = user;
    const { id, name, dataset } = widget;

    toastr.confirm(`Are you sure you want to remove the visualization: ${name}?`, {
      onOk: () => {
        deleteWidget(id, dataset, token)
          .then(() => { onWidgetRemove(); })
          .catch(({ message }) => toastr.error('Something went wrong deleting the widget', message));
      }
    });
  }
github resource-watch / resource-watch / components / areas / card / component.js View on Github external
const handleDeleteArea = () => {
    toastr.confirm(`Are you sure you want to delete the area ${area.name}?
      Deleting an area will delete all the subscriptions associated to it`,
    { onOk: () => { removeUserArea(area); } });
  };
github resource-watch / resource-watch / components / subscriptions / SubscriptionCard.js View on Github external
handleDeleteSubscription = () => {
    const { subscription, token } = this.props;
    const toastrConfirmOptions = {
      onOk: () => {
        this.setState({ loading: true });
        deleteSubscription(subscription.id, token)
          .then(() => {
            this.props.onSubscriptionRemoved();
          })
          .catch(err => toastr.error('Error', err));
      }
    };
    toastr.confirm('Are you sure you want to delete the subscription?', toastrConfirmOptions);
  }

react-redux-toastr

react-redux-toastr is a React toastr message implemented with Redux

MIT
Latest version published 9 months ago

Package Health Score

64 / 100
Full package analysis