react-redux-snackbar icon indicating copy to clipboard operation
react-redux-snackbar copied to clipboard

Way to show error, success, info messages

Open maxcc0 opened this issue 8 years ago • 3 comments

Is there a way I can set style by providing styles in the dispatch statement?

maxcc0 avatar Oct 25 '17 12:10 maxcc0

Not in the dispatch statement, but when adding the component to the page, loke so:

const snackStyles = {
  snack: {
    width: '300px',
    textAlign: 'center',
  },
};

<Snackbar customStyles={snackStyles}/>

I'll add more documentation about it soon.

But I guess you would want different looks, e.g depending on if its an error or info message. I'll figure out a solution for that.

wireforce avatar Nov 16 '17 09:11 wireforce

I guess adding a type property would work:

dispatch(showSnack('id', {
  label: 'saved',
  type: 'error' // info (default) | warning | error | success
}));

This attribute can than be translated to a className or styles on the snackbar.

smeijer avatar Jan 26 '18 12:01 smeijer

@wireforce providing a Example Project on how to use react-redux-snackbar will be a great add-on.

Naveen671 avatar Sep 24 '18 11:09 Naveen671