├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .npmignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── demo
├── demo.js
├── index.html
└── webpack.config.js
├── package.json
├── src
├── actions.js
├── components
│ ├── Notif.js
│ ├── NotifTransition.js
│ └── Notifs.js
├── index.js
├── reducer.js
└── styles.css
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "es2015",
4 | "stage-0",
5 | "react",
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 |
2 | # EditorConfig helps developers define and maintain consistent
3 | # coding styles between different editors and IDEs
4 | # editorconfig.org
5 |
6 | root = true
7 |
8 | [*]
9 | indent_style = space
10 | indent_size = 2
11 |
12 | [*.scss]
13 | indent_size = 4
14 |
15 | # We recommend you to keep these unchanged
16 | end_of_line = lf
17 | charset = utf-8
18 | trim_trailing_whitespace = true
19 | insert_final_newline = true
20 |
21 | [*.md]
22 | trim_trailing_whitespace = false
23 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | lib/*
2 | **/dist/*
3 | **/node_modules/*
4 | **/server.js
5 | **/webpack.config*.js
6 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "parser": "babel-eslint",
4 | "extends": "eslint-config-airbnb",
5 | "env": {
6 | "browser": true,
7 | "node": true,
8 | "mocha": true,
9 | },
10 | "rules": {
11 | "react/jsx-uses-vars": 2,
12 | "react/react-in-jsx-scope": 2,
13 | "react/jsx-quotes": 0,
14 | "react/jsx-filename-extension": 0,
15 | "jsx-quotes": 2,
16 | "comma-dangle": 0,
17 | "indent": [2, 2, {"SwitchCase": 1}],
18 | "max-len": 0,
19 | "no-console": 0,
20 | "no-alert": 0,
21 | "no-param-reassign": 0,
22 | "no-shadow": 0,
23 | "no-undef": 2,
24 | },
25 | "plugins": [
26 | "react"
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | *.log
3 | node_modules
4 | dist
5 | dist_demo
6 | lib
7 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | *.log
3 | examples
4 | test
5 | coverage
6 | _book
7 | book.json
8 | docs
9 | demo
10 | dist
11 | dist_demo
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Redux-Notifications Changelog
2 |
3 | ### 4.0.1 (June 27 2017)
4 | - Fix dependencies & add peerdependencies [#63](https://github.com/indexiatech/re-notif/pull/63)
5 |
6 | ### 4.0.0 (June 27 2017)
7 | - Remove import of styles.css [#56](https://github.com/indexiatech/re-notif/pull/56)
8 |
9 | ### 3.2.1 (June 27 2017)
10 | - Fix dependencies & add peerdependencies [#63](https://github.com/indexiatech/re-notif/pull/63)
11 |
12 | ### 3.2.0 (June 27 2017)
13 | - Migrate from React.PropTypes [#59](https://github.com/indexiatech/re-notif/pull/59)
14 | - Moving to new transition group method [#58](https://github.com/indexiatech/re-notif/pull/58)
15 | - Allow HTML/React elements in message content [#53](https://github.com/indexiatech/re-notif/pull/53)
16 | - Use Object-assign to support IE [#54](https://github.com/indexiatech/re-notif/pull/54/)
17 |
18 | ### 3.1.0 (December 14 2016)
19 | - Give CustomComponent access to notification data [#51](https://github.com/indexiatech/re-notif/pull/51)
20 |
21 | ### 3.0.0 (October 15 2016)
22 | - Remove CSS from Notifs component, let user optionally import [#47](https://github.com/indexiatech/re-notif/pull/47)
23 | - Use stateless components for Notifs
24 | - Improve `CustomComponent` API [#41](https://github.com/indexiatech/re-notif/pull/41)
25 | - Do not display notifications with the same ID [#45](https://github.com/indexiatech/re-notif/pull/45)
26 | - Drop peerDependencies
27 | - Update devDependencies
28 |
29 | ### 2.1.0 (June 28 2016)
30 | - Fixed custom component rendering
31 | - Pass ID to notif component
32 | - Fix `notifDismiss(id)` method
33 |
34 | ### 2.0.0 (June 28 2016)
35 | - MARJOR: Renamed package to `redux-notifications` on NPM
36 | - Proper linting
37 | - Removed unused code
38 | - #9 Support for React 15
39 | - Document API changes
40 | - Remove unused props
41 | - Add default styles
42 | - #3 Support for manual closing
43 |
44 | ### 1.0.1 (October 25 2015)
45 | - Version Bump
46 |
47 | ### 1.0.0 (October 21 2015)
48 | - React 0.14 support.
49 | - Better demo env structure.
50 | - Express instead of Webpack dev server.
51 | - Demo with Bootstrap instead of PureCss.
52 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015, indexiatech
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | * Neither the name of re-notif nor the names of its
15 | contributors may be used to endorse or promote products derived from
16 | this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # `redux-notifications`
2 |
3 | > ✔️: **Use the [use-disposable-list](https://github.com/asaf/use-disposable-list) (unstyled) hook that can work with any css framework!**
4 |
5 |
6 |
7 | > :warning: The previous package `re-notif` has been deprecated on NPM and renamed to `redux-notifications`. A list of changes can be found in the Changelog. Please update your applications accordingly.
8 |
9 | [React](https://github.com/facebook/react) & [Redux](https://github.com/rackt/redux) based notifications center.
10 |
11 | Thanks to Redux, the notification objects are maintained within Redux Store's State and are fired by Actions.
12 |
13 | ## Implementation
14 |
15 | ##### 1. Installation
16 |
17 | `npm install --save redux-notifications`
18 |
19 | ##### 2. The next thing you need to do is to add the `redux-notifications` `reducer` to Redux.
20 | ```js
21 | import { createStore, combineReducers } from 'redux'
22 | import { reducer as notifReducer } from 'redux-notifications';
23 | combineReducers({
24 | notifs: notifReducer,
25 | // ... more reducers here ...
26 | })
27 | ```
28 |
29 | ##### 3. Add the `Notifs` component at the root of your app
30 | ```js
31 | import { Provider } from 'react-redux'
32 | import { Notifs } from 'redux-notifications';
33 |
34 |
35 |
36 | // ... other things like router ...
37 |
38 |