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';
|
2022-02-02 05:33:12 -08:00
|
|
|
import { openModal, closeModal } from '../../../actions/modals';
|
2020-03-27 13:59:38 -07:00
|
|
|
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 => ({
|
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 => ({
|
|
|
|
|
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: () => {
|
2022-02-14 13:38:15 -08:00
|
|
|
dispatch(closeModal('ACTIONS'));
|
2020-09-27 16:02:57 -07:00
|
|
|
},
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(PrivacyDropdown);
|