How to use the react-toastify.toast function in react-toastify

To help you get started, we’ve selected a few react-toastify 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 MenloOne / block-overflow / src / models / Topics.tsx View on Github external
if (ipfsHash) {
                // Failed - unpin it from ipfs.menlo.one
                // this.localStorage.rm(ipfsHash)
                this.remoteStorage.unpin(ipfsHash)
            }

            let msg = e.message
            let timeout = 4000

            if (e.message === "Error: MetaMask Tx Signature: User denied transaction signature.") {
                msg = "You cancelled the MetaMask transaction."
                timeout = 1500
            }

            console.error(e)
            toast(msg, {
                autoClose: timeout,
                toastId: 123
            })
            throw e
        }
    }
}
github MenloOne / block-overflow / src / components / TopNav.tsx View on Github external
renderAccountStatus() {
        // console.log( 'STATUS: ', this.props.acct.model.status )

        if (true) {
            toast('This dApp is not connected to a Content Node. To launch your own Content Node, please visit menlo.one for more info.', {
                className: 'toast-red-bk',
                type: toast.TYPE.ERROR,
                toastId: ToastType.Account,
                autoClose: false
            })

            return (
                <ul>
                    <li>
                        <span>Not connected to Content Node. <a title="Launch a Content Node" href="https://www.menlo.one/docs/">Launch a Content Node</a></span>
                    </li>
                </ul>
            )
        }

        if (this.props.acct.model.status === MetamaskStatus.LoggedOut) {
github sanderhelleso / klourly / client / src / helpers / notification.js View on Github external
function login(success) {

    // prompt success toast if login was successfull
    if (success) {
        toast('Login Successfull! Redirecting...', {
            position: toast.POSITION.BOTTOM_CENTER,
            className: 'toast-success',
            progressClassName: 'success-progress-bar',
            autoClose: 2000,
            toastId: 1
        });
    }

    // propmt error toast if login failes
    else {
        toast('Invalid e-mail or password. Please try again', {
            position: toast.POSITION.BOTTOM_CENTER,
            className: 'toast-error',
            progressClassName: 'error-progress-bar',
            toastId: 2
        });
github flatlogic / react-material-admin / src / pages / notifications / NotificationsContainer.js View on Github external
sendNotification: props =&gt; (componentProps, options) =&gt; {
      return toast(
        ,
        options
      );
    }
  }),
github vm930 / devNote-frontend / src / componets / Code.js View on Github external
	notifySave = () => toast('auto saved!', { containerId: 'S' });
	notifyDelete = () => toast('code deleted!', { containerId: 'D' });
github ankaraboardgame / ankara / browser / react / Notification / NotificationComponent.js View on Github external
if (playerId === userId) {
            message = `You moved to ${locationName} - ${location}`;
          } else {
            message = `${playerMap[playerId]} moved to ${locationName} - ${location}`;
          }
          break;
        case LOGTYPE.SMUGGLER_MOVE:
          message = `Smugger moved to ${locationName} - ${location}`;
          break;
        default:
          message = '';
          break;
      }

      if ( message && message.trim() !== '') {
        toast(message, { type: toast.TYPE.INFO });
      }

    };
    this.gameLogRef.on('child_added', this.gameLogEventHandler);
github fkhadra / react-toastify / src / App.js View on Github external
componentDidMount() {
    toast("Default Notification !");
    toast.success("Success Notification !", {
      position: toast.POSITION.TOP_CENTER
    });
    toast.error("Error Notification !", {
      position: toast.POSITION.TOP_LEFT
    });
    toast.warn("Warning Notification !", {
      position: toast.POSITION.BOTTOM_LEFT
    });
    toast.info("Info Notification !", {
      position: toast.POSITION.BOTTOM_CENTER
    });
    toast("Custom Style Notification !", {
      position: toast.POSITION.BOTTOM_RIGHT,
      className: 'dark-toast',
      progressClassName: 'transparent-progress'
github Sunshine168 / Full-stack-Blog / my-blog / src / container / PostArticle.js View on Github external
return updatePost(params).then(result => {
        const {data} = result
        if (data) {
          toast("文章更新成功")
          sucCb();
        }
      });
    },
github fkhadra / react-toastify / src / BasicExample / CustomTransition.js View on Github external
notify = () => {
    toast("ZoomIn and ZoomOut", {
      autoClose: 5000,
      transition: Trans
    });
  };
github nlpathak / Scriptor / scriptor-app / src / components / ResSearch.js View on Github external
handleEnter = (e) => {
        if (e.key === 'Enter') {
            e.preventDefault();
            toast("Press the Search Button", {className: 'popup'});
        }
    };