##redux-notice
yarn add redux-notice
This isn't quite finished yet, but here's what it would look like!
##Example
##Install
Add the reducer
import reduxNotice from 'redux-notice/reducer'
let reducers = combineReducers({
reduxNotice
})
Add the Notices component to the top level
import Notices from 'redux-notice/component'
export default () => (
<Provider store={store}>
<div>
<Notices />
<Container />
<Footer />
</div>
</Provider>
);
Dispatch some notices!
import { addNotice } from 'redux-notice'
store.dispatch(
addNotice({
type: 'error',
text: 'You need to check your email and activate your account'
}),
);
##Options
Component
The notices component by default will display an icon, title and text
that you pass to the addNotice
action. You can change the actual component being rendered for each notice if this isn't good enough for you:
import Notices from 'redux-notice/component'
export default () => (
<Provider store={store}>
<div>
<Notices
item={error => <p>{error.text}</p>}
/>
</div>
</Provider>
);