Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pjediny/react-notification

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pjediny/react-notification

React redux notification

  • 0.0.9
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

React redux notification

Komponenta pre vykreslenie flash message. Zdrojom dat je redux.

Instalacia

npm i -S @pjediny/react-notification

Integracia

Reducer

import { notificationReducer } from '@pjediny/react-notification';

const rootReducer = combineReducers({
 notification: notificationReducer
});

export default rootReducer;

Routes

import Notifications from '@pjediny/react-notification';

export class Routes extends Component {
  render() {
    return (
      <div>
        <Notifications />
        <Switch>
          ...
        </Switch>
      </div>
    );
  }
}

export default Routes;

SCSS Importovat SCSS z node_modules/@pjediny/react-notification/src/scss/_notifications.scss

Pouzitie

import React, { Component } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { addSuccess, addError, addInfo, addWarning } from '@pjediny/react-notification';
import UserDatatable from './UserDatatable.jsx';

class Datatable extends Component {
  constructor(props) {
    super(props);
    this.createNotification = this.createNotification.bind(this);
  }

  createNotification() {
    this.props.actions.addSuccess('Info message', 'test', 1000);
    this.props.actions.addError('Info message');
    this.props.actions.addInfo('Info message');
    this.props.actions.addWarning('Info message');
  }

  render() {
    return (
      <div className="animated fadeIn">
        <button className="btn btn-info" onClick={this.createNotification}>
          Info
          </button>
        <div className="row">
          <div className="col-lg-12">
            <div className="card">
              <div className="card-header"><i className="fa fa-align-justify"></i>Users</div>
              <div className="card-block">
                <UserDatatable />
              </div>
            </div>
          </div>
        </div>
      </div>
    );
  }
}

const mapDispatchToProps = (dispatch) => ({
  actions: bindActionCreators({ addSuccess, addError, addInfo, addWarning }, dispatch)
});

export default connect(null, mapDispatchToProps)(Datatable);

License

MIT

Keywords

FAQs

Package last updated on 08 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc