How to use the react-toastify.toast.warn 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 Zenika / marcel / frontend / src / components / Client.js View on Github external
this.conn.onmessage = event => {
      console.log('Message received from server : ', event)
      if (event.data === 'update') {
        toast.dismiss()
        toast.warn('Ce Media a été mis à jour')
        this.getClient().then(this.setClient)
      }
    }
github Aedron / Luoo.qy / view / src / store / user / collection-track.ts View on Github external
setTimeout(() => {
      if (error || !ids) {
        console.error(error);
        toast.warn(liked ? "取消收藏失败" : "曲目收藏失败");
      } else {
        this.ids = ids;
        toast.warn(liked ? "取消收藏成功" : "曲目收藏成功");
      }
      this.fetchIds = this.fetchIds.filter(i => i !== id);
    }, timeout);
  };
github Aedron / Luoo.qy / view / src / store / user / collection-vol.ts View on Github external
setTimeout(() => {
      if (error || !ids) {
        console.error(error);
        toast.warn(liked ? "取消收藏失败" : "期刊收藏失败");
      } else {
        this.ids = ids;
        toast.warn(liked ? "取消收藏成功" : "期刊收藏成功");
      }
      this.fetchIds = this.fetchIds.filter(i => i !== id);
    }, timeout);
  };
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / lib / toast.tsx View on Github external
export function warning(msg: string, options: ToastOptions = {}) {
  notify.warn(msg, options);
}
github rclone / rclone-webui-react / src / views / RemoteManagement / NewDrive / NewDrive.js View on Github external
autoClose: false
                        });
                        this.stopAuthentication();
                    }

                }
            }
        } else {
            if (!this.state.colSetup) {
                this.openSetupDrive();
            }

            if (this.state.advancedOptions && !this.state.colAdvanced) {
                this.openAdvancedSettings();
            }
            toast.warn(`Check for errors before submitting.`, {
                autoClose: false
            });
        }
    }
github krissnawat / simple-react-upload / src / App.js View on Github external
maxSelectFile=(event)=>{
    let files = event.target.files
        if (files.length > 3) { 
           const msg = 'Only 3 images can be uploaded at a time'
           event.target.value = null
           toast.warn(msg)
           return false;
      }
    return true;
 }
 checkFileSize=(event)=>{
github microsoft / VoTT / src / react / components / common / tagInput / tagInput.tsx View on Github external
private updateTag = (oldTag: ITag, newTag: ITag) => {
        if (oldTag === newTag) {
            return;
        }
        if (!newTag.name.length) {
            toast.warn(strings.tags.warnings.emptyName);
            return;
        }
        if (newTag.name !== oldTag.name && this.state.tags.some((t) => t.name === newTag.name)) {
            toast.warn(strings.tags.warnings.existingName);
            return;
        }
        const tags = this.state.tags.map((t) => {
            return (t.name === oldTag.name) ? newTag : t;
        });
        this.setState({
            tags,
            editingTag: null,
            selectedTag: newTag,
        }, () => {
            this.props.onChange(tags);
        });
    }
github wfp / ui / src / components / Notification / Notification-story.js View on Github external
const notifyAll = () => {
      toast.success(
        <span>
           Wow so easy!
        </span>
      );
      toast.success('Wow so easy!');
      toast.warn('Please check again!');
      toast.error('Something went terribly wrong!');
    };
    return (
github HospitalRun / components / src / components / Toaster / index.tsx View on Github external
) => {
  const messageToShow = message ? titleWithMessage(title, message) : titleWithoutMessage(title)
  let toastToShow

  switch (type) {
    case 'error':
      toast.error(messageToShow)
      break
    case 'info':
      toast.info(messageToShow)
      break
    case 'success':
      toast.success(messageToShow)
      break
    case 'warning':
      toast.warn(messageToShow)
      break
    default:
      toast.error(messageToShow)
  }

  return toastToShow
}