bigbuffet-rw/app/soapbox/features/compose/containers/privacy_dropdown_container.js
marcin mikołajczak 807b3c7e5b Use stack for modals
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-30 18:53:47 +01:00

28 lines
841 B
JavaScript

import { connect } from 'react-redux';
import { changeComposeVisibility } from '../../../actions/compose';
import { openModal, closeModal } from '../../../actions/modal';
import { isUserTouching } from '../../../is_mobile';
import PrivacyDropdown from '../components/privacy_dropdown';
const mapStateToProps = state => ({
isModalOpen: state.get('modal').size && state.get('modal').last().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);