# onio-react-notification

> React redux notification

Latest version **0.0.10** (published 2017-09-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install onio-react-notification
pnpm add onio-react-notification
yarn add onio-react-notification
bun add onio-react-notification
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2017-09-28 |
| First published | 2017-09-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pavol Jediny |
| Maintainers | onio |
| Keywords | react, notification, flash message |

## Links

- npm: https://www.npmjs.com/package/onio-react-notification
- npm.io page: https://npm.io/package/onio-react-notification

## Dependencies (8)

- [redux](https://npm.io/package/redux.md) ^3.7.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10
- [react-redux](https://npm.io/package/react-redux.md) ^5.0.5
- [redux-types](https://npm.io/package/redux-types.md) ^1.0.0
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.6.1
- [react-transition-group](https://npm.io/package/react-transition-group.md) ^1.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.10 (latest) — 2017-09-28

## README

# 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

---
_Source: https://npm.io/package/onio-react-notification · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
