hometown/app/javascript/mastodon/features/compose/containers/federation_dropdown_container.js
2018-09-03 21:22:29 +02:00

25 lines
772 B
JavaScript

import { connect } from 'react-redux';
import FederationDropdown from '../components/federation_dropdown';
import { changeComposeFederation } from '../../../actions/compose';
import { openModal, closeModal } from '../../../actions/modal';
import { isUserTouching } from '../../../is_mobile';
const mapStateToProps = state => ({
isModalOpen: state.get('modal').modalType === 'ACTIONS',
value: state.getIn(['compose', 'federation']),
});
const mapDispatchToProps = dispatch => ({
onChange (value) {
dispatch(changeComposeFederation(value));
},
isUserTouching,
onModalOpen: props => dispatch(openModal('ACTIONS', props)),
onModalClose: () => dispatch(closeModal()),
});
export default connect(mapStateToProps, mapDispatchToProps)(FederationDropdown);