Commit 4c622873 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov
Browse files

Merge branch '208-bug-5x-snackbar-message' into 'master'

Bug: 5x Snackbar message

Closes #208

See merge request genesys-pgr/genesys-ui!216
parents 5a40f946 8680b71d
......@@ -5,7 +5,7 @@ import {connect} from 'react-redux';
import Snackbar_ from '@material-ui/core/Snackbar';
interface ISnacks {
snack: string;
snack: any; // string;
button?: any;
t: any;
}
......@@ -26,13 +26,20 @@ class Snackbar extends React.Component<ISnacks, any> {
public componentWillMount() {
const { snack } = this.props;
// console.log('Snack willMount', snack);
this.pushSnack(snack);
if (snack) {
this.queue.push({
message: snack.message,
key: new Date().getTime(),
});
}
}
public componentWillReceiveProps(nextProps) {
if (!this.props.snack || nextProps.snack && this.props.snack && (nextProps.snack.message !== this.props.snack.message)) {
const { snack } = nextProps;
// console.log('Snack willReceive', snack);
this.pushSnack(snack);
}
}
private pushSnack(snack) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment