bigbuffet-rw/app/soapbox/features/compose/containers/privacy_dropdown_container.js
2020-09-27 18:02:57 -05:00

27 lines
806 B
JavaScript

import { connect } from 'react-redux';
import PrivacyDropdown from '../components/privacy_dropdown';
import { changeComposeVisibility } 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', 'privacy']),
});
const mapDispatchToProps = dispatch => ({
onChange(value) {
dispatch(changeComposeVisibility(value));
},
isUserTouching,
onModalOpen: props => dispatch(openModal('ACTIONS', props)),
onModalClose: () => {
dispatch(closeModal());
dispatch(openModal('COMPOSE'));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(PrivacyDropdown);