How to use react-notifications - 10 common examples

To help you get started, we’ve selected a few react-notifications 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 chriszhangusc / soundnode-redux / client / redux / middlewares / notificationMiddleware.js View on Github external
const notificationMiddleware = () => next => (action) => {
  if (!action.type) return next(action);
  if (action.type.indexOf('SUCCESS') > -1) {
    // console.log(action.type);
    NotificationManager.success(action.payload.message, SUCCESS);
  } else if (action.type.indexOf('FAILED') > -1) {
    // console.log(action.type);
    NotificationManager.error(action.payload.message, ERROR);
  }
  return next(action);
};
github kartikayg / StatusPage / ui-app / src / shared / pages / admin / components.js View on Github external
render={(subProps) => {

            // find the component based on the id
            const { id } = subProps.match.params;
            const component = props.components.find(c => {
              return c.id === id;
            });

            if (!component) {
              NotificationManager.error('Component not found.');
              subProps.history.push('/admin/components');
            }

            return <form>;
          }}
        /&gt;</form>
github kartikayg / StatusPage / ui-app / src / shared / pages / admin / incidents.js View on Github external
render={(subProps) =&gt; {

            // find the instance based on the id
            const { id } = subProps.match.params;
            const incident = props.incidents.find(i =&gt; {
              return i.id === id;
            });

            if (!incident) {
              NotificationManager.error('Incident not found.');
              return ;
            }

            return ;

          }}
        /&gt;
github l3p-cv / lost / frontend / lost / src / components / Users / CreateUser.js View on Github external
componentDidUpdate() {
        if (this.props.createMessage === 'success') {
            NotificationManager.success(`User ${this.state.createUsername} created.`)
        } else if (this.props.createMessage !== '') {
            NotificationManager.error(this.props.createMessage)
        }
        this
            .props
            .cleanCreateUserMessage()
    }
    createUserCheckGroup(rowInfo, choosenGroups) {
github l3p-cv / lost / frontend / lost / src / components / Labels / CreateLabelTree.js View on Github external
componentDidUpdate() {
        if (this.props.createMessage === 'success') {
            NotificationManager.success(`LabelTree created.`)
        } else if (this.props.createMessage !== '') {
            NotificationManager.error(this.props.createMessage)
        }
        this
            .props
            .cleanLabelMessages()
    }
    render() {
github l3p-cv / lost / frontend / lost / src / components / Users / CreateGroup.js View on Github external
componentDidUpdate() {
        if (this.props.createMessage === 'success') {
            NotificationManager.success(`Group ${this.state.createGroupName} created.`)
        } else if (this.props.createMessage !== '') {
            NotificationManager.error(this.props.createMessage)
        }
        this
            .props
            .cleanGroupCreateMessage()
    }
    render() {
github l3p-cv / lost / frontend / lost / src / components / Users / GroupList.js View on Github external
componentDidUpdate() {
        if (this.props.deleteMessage === 'success') {
            NotificationManager.success(`Group with id ${this.state.clickedGroup} deleted.`)
        } else if (this.props.deleteMessage !== '') {
            NotificationManager.error(this.props.deleteMessage)
        }
        this
            .props
            .cleanGroupDeleteMessage()
    }
github l3p-cv / lost / frontend / lost / src / components / Users / UserTable.js View on Github external
componentDidUpdate() {
        if (this.props.deleteMessage === 'success') {
            NotificationManager.success(`User successfully deleted.`)
        } else if (this.props.deleteMessage !== '') {
            NotificationManager.error(this.props.deleteMessage)
        }
        this
            .props
            .cleanDeleteUserMessage()

        if (this.props.updateMessage === 'success') {
            NotificationManager.success(`User successfully updated.`)
        } else if (this.props.updateMessage !== '') {
            NotificationManager.error(this.props.updateMessage)
        }
        this
            .props
            .cleanUpdateUserMessage()
    }
    validateInputAndUpdateBackend(original, updateUser) {
github kartikayg / StatusPage / ui-app / src / shared / pages / login.js View on Github external
.catch(err => {
        NotificationManager.error(err.message);
        this.setState({ saving: false });
      });
github kartikayg / StatusPage / ui-app / src / shared / pages / manage-subscription.js View on Github external
onSendConfirmationLink = async (e) => {

    e.preventDefault();

    try {
      const resp = await apiGateway.get(`/subscriptions/${this.state.subscriptionObj.id}/send_confirmation_link`);
      NotificationManager.success(resp.message);
    }
    catch (err) {
      NotificationManager.error(err.message);
    }

  }

react-notifications

Notification component for ReactJS

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis

Popular react-notifications functions