bigbuffet-rw/app/soapbox/features/compose/containers/privacy_dropdown_container.js
marcin mikołajczak b8be588b60 Post editing: Compose improvements
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-05-03 23:00:07 +02:00

28 lines
875 B
JavaScript

import { connect } from 'react-redux';
import { changeComposeVisibility } from '../../../actions/compose';
import { openModal, closeModal } from '../../../actions/modals';
import { isUserTouching } from '../../../is_mobile';
import PrivacyDropdown from '../components/privacy_dropdown';
const mapStateToProps = state => ({
isModalOpen: Boolean(state.get('modals').size && state.get('modals').last().modalType === 'ACTIONS'),
value: state.getIn(['compose', 'privacy']),
unavailable: !!state.getIn(['compose', 'id']),
});
const mapDispatchToProps = dispatch => ({
onChange(value) {
dispatch(changeComposeVisibility(value));
},
isUserTouching,
onModalOpen: props => dispatch(openModal('ACTIONS', props)),
onModalClose: () => {
dispatch(closeModal('ACTIONS'));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(PrivacyDropdown);