From 538d109a8268d639032e432ed6138ed57f35e5ef Mon Sep 17 00:00:00 2001 From: Anthony Bellew Date: Fri, 23 Dec 2016 07:20:16 -0700 Subject: Re-add unlisted toggle to the UI --- .../features/compose/components/compose_form.jsx | 14 +++++++++++++- .../features/compose/containers/compose_form_container.jsx | 8 +++++++- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'app/assets/javascripts/components/features') diff --git a/app/assets/javascripts/components/features/compose/components/compose_form.jsx b/app/assets/javascripts/components/features/compose/components/compose_form.jsx index 6a0e6778d..1de3e068b 100644 --- a/app/assets/javascripts/components/features/compose/components/compose_form.jsx +++ b/app/assets/javascripts/components/features/compose/components/compose_form.jsx @@ -34,7 +34,8 @@ const ComposeForm = React.createClass({ onFetchSuggestions: React.PropTypes.func.isRequired, onSuggestionSelected: React.PropTypes.func.isRequired, onChangeSensitivity: React.PropTypes.func.isRequired, - onChangeVisibility: React.PropTypes.func.isRequired + onChangeVisibility: React.PropTypes.func.isRequired, + onChangeListability: React.PropTypes.func.isRequired, }, mixins: [PureRenderMixin], @@ -73,6 +74,10 @@ const ComposeForm = React.createClass({ handleChangeVisibility (e) { this.props.onChangeVisibility(e.target.checked); }, + + handleChangeListability (e) { + this.props.onChangeListability(e.target.checked); + }, componentDidUpdate (prevProps) { if (prevProps.in_reply_to !== this.props.in_reply_to) { @@ -120,6 +125,13 @@ const ComposeForm = React.createClass({ + + + + - - - - - + + {({ opacity, height }) => + + } + + + + {({ opacity, height }) => + + } + ); } diff --git a/app/assets/javascripts/components/features/compose/containers/compose_form_container.jsx b/app/assets/javascripts/components/features/compose/containers/compose_form_container.jsx index 00c641fb9..1d8f20ca7 100644 --- a/app/assets/javascripts/components/features/compose/containers/compose_form_container.jsx +++ b/app/assets/javascripts/components/features/compose/containers/compose_form_container.jsx @@ -26,7 +26,8 @@ const makeMapStateToProps = () => { private: state.getIn(['compose', 'private']), is_submitting: state.getIn(['compose', 'is_submitting']), is_uploading: state.getIn(['compose', 'is_uploading']), - in_reply_to: getStatus(state, state.getIn(['compose', 'in_reply_to'])) + in_reply_to: getStatus(state, state.getIn(['compose', 'in_reply_to'])), + media_count: state.getIn(['compose', 'media_attachments']).size }; }; @@ -66,7 +67,7 @@ const mapDispatchToProps = function (dispatch) { onChangeVisibility (checked) { dispatch(changeComposeVisibility(checked)); }, - + onChangeListability (checked) { dispatch(changeComposeListability(checked)); } -- cgit