bastodon/app/javascript/mastodon/features/compose/containers/privacy_dropdown_container.js

25 lines
760 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2017-03-25 00:01:43 +01:00
import PrivacyDropdown from '../components/privacy_dropdown';
import { changeComposeVisibility } from '../../../actions/compose';
import { openModal, closeModal } from '../../../actions/modal';
import { isUserTouching } from '../../../is_mobile';
const mapStateToProps = state => ({
isModalOpen: state.get('modal').modalType === 'ACTIONS',
value: state.getIn(['compose', 'privacy']),
});
const mapDispatchToProps = dispatch => ({
2017-03-25 00:01:43 +01:00
onChange (value) {
dispatch(changeComposeVisibility(value));
},
isUserTouching,
onModalOpen: props => dispatch(openModal('ACTIONS', props)),
onModalClose: () => dispatch(closeModal()),
});
2017-03-25 00:01:43 +01:00
export default connect(mapStateToProps, mapDispatchToProps)(PrivacyDropdown);