dae78c488f
From the previous commit, we are now showing toasts in the reverse order (latest to oldest). Next, extend the "hide snack" timer to handle multiple snacks. It will dismiss them one by one, restarting itself until no more toasts. Show a stacked GUI when there are multiple toasts. Users can still manually dismiss the toasts.
15 lines
452 B
JavaScript
15 lines
452 B
JavaScript
import { connect } from 'react-redux';
|
|
import { doDismissToast } from 'redux/actions/notifications';
|
|
import { selectToast, selectToastCount } from 'redux/selectors/notifications';
|
|
import SnackBar from './view';
|
|
|
|
const perform = (dispatch) => ({
|
|
removeSnack: () => dispatch(doDismissToast()),
|
|
});
|
|
|
|
const select = (state) => ({
|
|
snack: selectToast(state),
|
|
snackCount: selectToastCount(state),
|
|
});
|
|
|
|
export default connect(select, perform)(SnackBar);
|