bigbuffet-rw/app/soapbox/features/compose/containers/privacy_dropdown_container.js

28 lines
826 B
JavaScript
Raw Normal View History

2020-03-27 13:59:38 -07:00
import { connect } from 'react-redux';
2020-03-27 13:59:38 -07:00
import { changeComposeVisibility } from '../../../actions/compose';
import { openModal, closeModal } from '../../../actions/modals';
2020-03-27 13:59:38 -07:00
import { isUserTouching } from '../../../is_mobile';
import PrivacyDropdown from '../components/privacy_dropdown';
2020-03-27 13:59:38 -07:00
const mapStateToProps = state => ({
2022-03-21 11:09:01 -07:00
isModalOpen: Boolean(state.get('modals').size && state.get('modals').last().modalType === 'ACTIONS'),
2020-03-27 13:59:38 -07:00
value: state.getIn(['compose', 'privacy']),
});
const mapDispatchToProps = dispatch => ({
onChange(value) {
2020-03-27 13:59:38 -07:00
dispatch(changeComposeVisibility(value));
},
isUserTouching,
onModalOpen: props => dispatch(openModal('ACTIONS', props)),
onModalClose: () => {
dispatch(closeModal('ACTIONS'));
},
2020-03-27 13:59:38 -07:00
});
export default connect(mapStateToProps, mapDispatchToProps)(PrivacyDropdown);