How to use react-notify-toast - 10 common examples

To help you get started, we’ve selected a few react-notify-toast 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 peterjoseph / Reeve / client / modules / header / index.js View on Github external
this.props.logoutUser().then(result => {
			if (result.type === LOGOUT_REJECTED) {
				// Display error notification
				notify.show(t("error.logout"), "error");
			} else {
				clearToken(); // Clear security token in browser
				fetch.clearSecurityToken(); // Clear token in fetch header

				// Refresh Browser Window
				const url = `${BUILD_PROTOCOL}://${this.props.user.get("workspaceURL")}.${BUILD_DOMAINPATH}/signin`;
				window.location.replace(url);
			}
		});
	}
github peterjoseph / Reeve / client / modules / header / index.js View on Github external
this.props.logoutUser().then(result => {
			if (result.type === LOGOUT_REJECTED) {
				// Display error notification
				notify.show(t("error.logout"), "error");
			} else {
				clearToken(); // Clear security token in browser
				fetch.clearSecurityToken(); // Clear token in fetch header

				// Refresh Browser Window
				const url = `${BUILD_PROTOCOL}://${this.props.user.get("workspaceURL")}.${BUILD_DOMAINPATH}/signin`;
				window.location.replace(url);
			}
		});
	}
github lxerxa / actionview-fe / app / components / issue / DetailBar.jsx View on Github external
async assignToMe(e) {
    e.preventDefault();
    const { setAssignee, data } = this.props;
    const ecode = await setAssignee(data.id, { assignee: 'me' });
    if (ecode === 0) {
      notify.show('已分配给我。', 'success', 2000);
    } else {
      notify.show('问题分配失败。', 'error', 2000);
    }
    // fix me
    //if (ecode === 0) {
    //} else {
    //}
  }
github maximevaillancourt / trace / src / App.js View on Github external
event.watch((error, result) => {
          if (!error){
            this.props.history.push('/');
            notify.show("Product created.", "custom", 5000, { background: '#50b796', text: "#FFFFFF" });
          } else {
            console.log(error);
          }
        });
github lxerxa / actionview-fe / app / components / issue / SaveFilterModal.jsx View on Github external
async handleSubmit() {
    const { values, create, close, query={} } = this.props;
    values.query = _.omit(query, [ 'page' ]);
    const ecode = await create(values);
    if (ecode === 0) {
      this.setState({ ecode: 0 });
      close();
      notify.show('保存完成。', 'success', 2000);
    } else {
      this.setState({ ecode: ecode });
    }
  }
github lxerxa / actionview-fe / app / components / user / ImportModal.jsx View on Github external
async handleSubmit() {
    const { index, imports, close } = this.props;
    const ecode = await imports(_.pick(this.state, [ 'fid', 'pattern' ]));
    if (ecode === 0) {
      this.setState({ ecode: 0 });
      close();
      notify.show('导入完成。', 'success', 2000);
      index();
    } else {
      this.setState({ ecode: ecode });
    }
  }
github lxerxa / actionview-fe / app / components / project / EditModal.jsx View on Github external
async handleSubmit() {
    const { values, update, close } = this.props;
    const ecode = await update(values.id, _.extend({}, _.omit(values, ['id']), { principal: values.principal && values.principal.id || '' }));
    if (ecode === 0) {
      this.setState({ ecode: 0 });
      close();
      notify.show('项目已更新。', 'success', 2000);
    } else {
      this.setState({ ecode: ecode });
    }
  }
github lxerxa / actionview-fe / app / components / issue / CopyModal.jsx View on Github external
async handleSubmit() {
    const { values, copy, close } = this.props;
    const ecode = await copy(_.mapKeys(values, function (value, key) { return key == 'id' ? 'source_id' : key }));
    if (ecode === 0) {
      this.setState({ ecode: 0 });
      close();
      notify.show('复制完成。', 'success', 2000);
    } else {
      this.setState({ ecode: ecode });
    }
  }
github lxerxa / actionview-fe / app / components / project / CreateModal2.jsx View on Github external
async handleSubmit() {
    const { values, create, close } = this.props;
    const ecode = await create(values);
    if (ecode === 0) {
      this.setState({ ecode: 0 });
      close();
      notify.show('创建完成。', 'success', 2000);
    } else {
      this.setState({ ecode: ecode });
    }
  }
github lxerxa / actionview-fe / app / components / webhooks / List.jsx View on Github external
async operateSelect(eventKey) {
    const { hoverRowId } = this.state;
    const { test } = this.props;
    if (eventKey == 'test') {
      const ecode = await test(hoverRowId);
      if (ecode === 0) {
        notify.show('测试成功。', 'success', 2000);
      } else {
        notify.show('测试失败', 'error', 2000);
      }
    } else {
      this.operateNotify(hoverRowId);
      this.setState({ operate: eventKey });
    }
  }

react-notify-toast

Toast notifications for React.js

MIT
Latest version published 5 years ago

Package Health Score

51 / 100
Full package analysis

Popular react-notify-toast functions