bigbuffet-rw/app/soapbox/features/ui/containers/modal_container.js
marcin mikołajczak b0477ac1e1 fix broken modals
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-07 00:50:32 +01:00

22 lines
646 B
JavaScript

import { connect } from 'react-redux';
import { closeModal } from '../../../actions/modal';
import { cancelReplyCompose } from '../../../actions/compose';
import ModalRoot from '../components/modal_root';
const mapStateToProps = state => ({
type: state.get('modal').modalType,
props: state.get('modal').modalProps,
noPop: state.get('modal').noPop,
});
const mapDispatchToProps = (dispatch) => ({
onClose(optionalType, noPop) {
if (optionalType === 'COMPOSE') {
dispatch(cancelReplyCompose());
}
dispatch(closeModal(undefined, noPop));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(ModalRoot);