bigbuffet-rw/app/soapbox/features/ui/containers/modal_container.js

22 lines
588 B
JavaScript
Raw Normal View History

2020-03-27 13:59:38 -07:00
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,
});
const mapDispatchToProps = (dispatch) => ({
onClose(optionalType) {
2020-03-27 13:59:38 -07:00
if (optionalType === 'COMPOSE') {
2020-04-14 11:44:40 -07:00
dispatch(cancelReplyCompose());
2020-03-27 13:59:38 -07:00
}
dispatch(closeModal());
},
});
export default connect(mapStateToProps, mapDispatchToProps)(ModalRoot);