Skip to content

kimmelsg/cj-redux-notice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##redux-notice

yarn add redux-notice

This isn't quite finished yet, but here's what it would look like!

##Example

Notice

##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'
  }),
);

Notice

##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>
);

About

Display iOS style notices in your redux apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published