lbry-desktop/ui/component/snackBar/index.js
infinite-persistence dae78c488f Stacked toast view
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.
2022-05-06 13:53:39 -04:00

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