2020-03-27 13:59:38 -07:00
|
|
|
import { connect } from 'react-redux';
|
2022-01-10 14:25:06 -08:00
|
|
|
|
2020-03-27 13:59:38 -07:00
|
|
|
import { changeComposeVisibility } from '../../../actions/compose';
|
|
|
|
import { openModal, closeModal } from '../../../actions/modal';
|
|
|
|
import { isUserTouching } from '../../../is_mobile';
|
2022-01-10 14:17:52 -08:00
|
|
|
import PrivacyDropdown from '../components/privacy_dropdown';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
|
|
isModalOpen: state.get('modal').modalType === 'ACTIONS',
|
|
|
|
value: state.getIn(['compose', 'privacy']),
|
|
|
|
});
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
|
2020-04-14 14:47:35 -07:00
|
|
|
onChange(value) {
|
2020-03-27 13:59:38 -07:00
|
|
|
dispatch(changeComposeVisibility(value));
|
|
|
|
},
|
|
|
|
|
|
|
|
isUserTouching,
|
|
|
|
onModalOpen: props => dispatch(openModal('ACTIONS', props)),
|
2020-09-27 16:02:57 -07:00
|
|
|
onModalClose: () => {
|
|
|
|
dispatch(closeModal());
|
|
|
|
dispatch(openModal('COMPOSE'));
|
|
|
|
},
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(PrivacyDropdown);
|