How to use the react-toastify.toast.TYPE 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 / 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) {
            toast('You must first sign into Metamask to take part in discussions.', {
                toastId: ToastType.Account,
github codeforkansascity / Neighborhood-Dashboard / app / js / components / crime.jsx View on Github external
.catch(function(error) {
                console.log('error retrieving or setting crime pins');
                console.log(error);
                _this.setState({
                    loading: false
                });

                toast(
                    <p>
                        We're sorry, but the application could not process your request. Please try again later.
                    </p>,
                    {
                        type: toast.TYPE.INFO
                    }
                );
            });
    }
github attivio / suit / src / components / Notifiable.js View on Github external
static success(message: string, requireDismissal: boolean = false) {
    Notifiable.showNotification(message, toast.TYPE.SUCCESS, requireDismissal);
  }
github eez-open / studio / packages / eez-studio-ui / notification.tsx View on Github external
export function dismiss(toastId: number) {
    toast.dismiss(toastId);
}

export const container = (
    
);

export const INFO = toast.TYPE.INFO;
export const SUCCESS = toast.TYPE.SUCCESS;
export const WARNING = toast.TYPE.WARNING;
export const ERROR = toast.TYPE.ERROR;
github timroesner / WeMart / src / Checkout.js View on Github external
    notify = () =&gt; this.orderToast = toast("Placing Order", { type: toast.TYPE.INFO, autoClose: false});
    toastSuccess = () =&gt; toast.update(this.orderToast, { type: toast.TYPE.SUCCESS,autoClose: 3000, render: <div><h4>Order Succesfully Placed</h4><h5>Redirecting to homepage</h5></div>, onClose: () =&gt; this.props.history.push('/home') });
github bigbluebutton / bigbluebutton / bigbluebutton-html5 / imports / ui / components / toast / component.jsx View on Github external
const propTypes = {
  icon: PropTypes.string,
  message: PropTypes.node.isRequired,
  type: PropTypes.oneOf(Object.values(toast.TYPE)).isRequired,
};

const defaultProps = {
  icon: null,
};

const defaultIcons = {
  [toast.TYPE.INFO]: 'help',
  [toast.TYPE.SUCCESS]: 'checkmark',
  [toast.TYPE.WARNING]: 'warning',
  [toast.TYPE.ERROR]: 'close',
  [toast.TYPE.DEFAULT]: 'about',
};

const Toast = ({
  icon,
  type,
  message,
  content,
  small,
}) =&gt; (
  <div role="alert">
    <div>
      <div></div></div></div>
github flatlogic / react-dashboard / src / pages / notifications / Notifications.js View on Github external
  retryNotification = (id) =>  toast.update(id, {...this.state.options, render: 'Alien planet destroyed!', type: toast.TYPE.SUCCESS });
github DCU-ICSLab / palm-to-farm / ProjectPurple / Web / FrontEnd / src / containers / MainContainer / MainContainer.js View on Github external
_showAlert = (data) => {
        let type = toast.TYPE.SUCCESS
        if (data.msg) {
            if (data.status !== 'OK') {
                type = toast.TYPE.ERROR;
            }
            this.toastId = toast(
                data.msg, {
                    autoClose: 4000,
                    type: type,
                });
        }
    }
github codeforkansascity / Neighborhood-Dashboard / app / js / components / map.jsx View on Github external
.catch(function(error) {
        toast(
          <p>Main Neighborhood map could not load. Please try again later,
            or try the neighborhood search.</p>, {
              type: toast.TYPE.INFO,
            });
      });
  }