about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/ui/containers/modal_container.js
blob: ad1e8a2eeaaad7d72384c924c07d98d6cc3d5fd3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { connect } from 'react-redux';
import { closeModal } from '../../../actions/modal';
import ModalRoot from '../components/modal_root';

const mapStateToProps = state => ({
  type: state.getIn(['modal', 0, 'modalType'], null),
  props: state.getIn(['modal', 0, 'modalProps'], {}),
});

const mapDispatchToProps = dispatch => ({
  onClose () {
    dispatch(closeModal());
  },
});

export default connect(mapStateToProps, mapDispatchToProps)(ModalRoot);