How to use the react-toastify.toast.warning 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 plgd-dev / cloud / http-gateway / web / src / components / toast / index.js View on Github external
dispatchedToasts--
      }

      if (options?.onClose) {
        options.onClose(props)
      }
    }

    const toastOptions = { ...options, onClose: onToastClose }

    switch (type) {
      case SUCCESS:
        toast.success(renderToast, toastOptions)
        break
      case WARNING:
        toast.warning(renderToast, toastOptions)
        break
      case INFO:
        toast.info(renderToast, toastOptions)
        break
      default:
        toast.error(renderToast, toastOptions)
    }
  } else if (options?.isNotification) {
    // If it is a notification, try to push it to the browser if borwser notifications are enabled
    // - Emit a an event to be processed in the BrowserNotificationsContainer
    Emitter.emit(
      BROWSER_NOTIFICATIONS_EVENT_KEY,
      {
        message: toastMessage,
        title: toastTitle,
      },
github TimDaub / ERC721-wallet / src / components / Wallet.js View on Github external
async checkMetamaskSetup() {
    const web3 = await getWeb3();
    if (web3.currentProvider.isMetaMask) {
      const accounts = await web3.eth.getAccounts();
      if (accounts.length) {
        let contracts = localStorage.getItem("tokens");
        contracts = contracts.split(",");

        this.props.getTransactions(web3, accounts[0], contracts);
        this.setState({ accounts });
      } else {
        toast.warning("Unlock Metamask");
      }
    } else {
      toast.warning("Install Metamask");
    }
  }
github TimDaub / ERC721-wallet / src / components / Wallet.js View on Github external
async checkMetamaskSetup() {
    const web3 = await getWeb3();
    if (web3.currentProvider.isMetaMask) {
      const accounts = await web3.eth.getAccounts();
      if (accounts.length) {
        let contracts = localStorage.getItem("tokens");
        contracts = contracts.split(",");

        this.props.getTransactions(web3, accounts[0], contracts);
        this.setState({ accounts });
      } else {
        toast.warning("Unlock Metamask");
      }
    } else {
      toast.warning("Install Metamask");
    }
  }
github webkom-co / airframe-next / app / routes / Interface / Notifications / Notifications.js View on Github external
_showHandler = () => {
        switch(this.state.type) {
            case 'info':
                toast.info(contentInfo);
            break;
            case 'success':
                toast.success(contentSuccess);
            break;
            case 'warning':
                toast.warning(contentWarning);
            break;
            case 'error':
                toast.error(contentError);
            break;
            default:
                toast(contentDefault);
            break;
        }
    }
github TimDaub / ERC721-wallet / src / components / Start.js View on Github external
async checkMetamaskSetup() {
    const web3 = await getWeb3();
    if (web3.currentProvider.isMetaMask) {
      const accounts = await web3.eth.getAccounts();
      if (accounts.length) {
        this.props.history.push("wallet");
      } else {
        toast.warning("Unlock Metamask");
      }
    } else {
      toast.warning("Install Metamask");
    }
  }
github webkom-co / airframe-next / pages / interface / notifications.js View on Github external
_showHandler = () => {
        switch(this.state.type) {
            case 'info':
                toast.info(contentInfo);
            break;
            case 'success':
                toast.success(contentSuccess);
            break;
            case 'warning':
                toast.warning(contentWarning);
            break;
            case 'error':
                toast.error(contentError);
            break;
            default:
                toast(contentDefault);
            break;
        }
    }
github TimDaub / ERC721-wallet / src / components / Start.js View on Github external
async checkMetamaskSetup() {
    const web3 = await getWeb3();
    if (web3.currentProvider.isMetaMask) {
      const accounts = await web3.eth.getAccounts();
      if (accounts.length) {
        this.props.history.push("wallet");
      } else {
        toast.warning("Unlock Metamask");
      }
    } else {
      toast.warning("Install Metamask");
    }
  }