about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/compose/containers/private_toggle_container.jsx
blob: ee3596902eca2ecd50fd5d77781c5bd748c79c5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { connect } from 'react-redux';
import PrivateToggle from '../components/private_toggle';
import { changeComposeVisibility } from '../../../actions/compose';

const mapStateToProps = state => ({
  isPrivate: state.getIn(['compose', 'private'])
});

const mapDispatchToProps = dispatch => ({

  onChange (e) {
    dispatch(changeComposeVisibility(e.target.checked));
  }

});

export default connect(mapStateToProps, mapDispatchToProps)(PrivateToggle);