From 50d3083cbddf410e9024fb59559c46e9390a5662 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 13 Nov 2016 19:08:52 +0100 Subject: Making upload button into a smaller icon button --- .../ui/containers/compose_form_container.jsx | 58 ---------------------- .../ui/containers/follow_form_container.jsx | 24 --------- .../ui/containers/navigation_container.jsx | 8 --- .../ui/containers/upload_form_container.jsx | 25 ---------- 4 files changed, 115 deletions(-) delete mode 100644 app/assets/javascripts/components/features/ui/containers/compose_form_container.jsx delete mode 100644 app/assets/javascripts/components/features/ui/containers/follow_form_container.jsx delete mode 100644 app/assets/javascripts/components/features/ui/containers/navigation_container.jsx delete mode 100644 app/assets/javascripts/components/features/ui/containers/upload_form_container.jsx (limited to 'app/assets/javascripts/components/features/ui/containers') diff --git a/app/assets/javascripts/components/features/ui/containers/compose_form_container.jsx b/app/assets/javascripts/components/features/ui/containers/compose_form_container.jsx deleted file mode 100644 index 87bcd6b99..000000000 --- a/app/assets/javascripts/components/features/ui/containers/compose_form_container.jsx +++ /dev/null @@ -1,58 +0,0 @@ -import { connect } from 'react-redux'; -import ComposeForm from '../components/compose_form'; -import { - changeCompose, - submitCompose, - cancelReplyCompose, - clearComposeSuggestions, - fetchComposeSuggestions, - selectComposeSuggestion -} from '../../../actions/compose'; -import { makeGetStatus } from '../../../selectors'; - -const makeMapStateToProps = () => { - const getStatus = makeGetStatus(); - - const mapStateToProps = function (state, props) { - return { - text: state.getIn(['compose', 'text']), - suggestion_token: state.getIn(['compose', 'suggestion_token']), - suggestions: state.getIn(['compose', 'suggestions']).toJS(), - 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'])) - }; - }; - - return mapStateToProps; -}; - -const mapDispatchToProps = function (dispatch) { - return { - onChange (text) { - dispatch(changeCompose(text)); - }, - - onSubmit () { - dispatch(submitCompose()); - }, - - onCancelReply () { - dispatch(cancelReplyCompose()); - }, - - onClearSuggestions () { - dispatch(clearComposeSuggestions()); - }, - - onFetchSuggestions (token) { - dispatch(fetchComposeSuggestions(token)); - }, - - onSuggestionSelected (position, accountId) { - dispatch(selectComposeSuggestion(position, accountId)); - } - } -}; - -export default connect(makeMapStateToProps, mapDispatchToProps)(ComposeForm); diff --git a/app/assets/javascripts/components/features/ui/containers/follow_form_container.jsx b/app/assets/javascripts/components/features/ui/containers/follow_form_container.jsx deleted file mode 100644 index 05cfb7c1d..000000000 --- a/app/assets/javascripts/components/features/ui/containers/follow_form_container.jsx +++ /dev/null @@ -1,24 +0,0 @@ -import { connect } from 'react-redux'; -import FollowForm from '../components/follow_form'; -import { changeFollow, submitFollow } from '../../../actions/follow'; - -const mapStateToProps = function (state, props) { - return { - text: state.getIn(['follow', 'text']), - is_submitting: state.getIn(['follow', 'is_submitting']) - }; -}; - -const mapDispatchToProps = function (dispatch) { - return { - onChange: function (text) { - dispatch(changeFollow(text)); - }, - - onSubmit: function (router) { - dispatch(submitFollow(router)); - } - } -}; - -export default connect(mapStateToProps, mapDispatchToProps)(FollowForm); diff --git a/app/assets/javascripts/components/features/ui/containers/navigation_container.jsx b/app/assets/javascripts/components/features/ui/containers/navigation_container.jsx deleted file mode 100644 index 51e2513d8..000000000 --- a/app/assets/javascripts/components/features/ui/containers/navigation_container.jsx +++ /dev/null @@ -1,8 +0,0 @@ -import { connect } from 'react-redux'; -import NavigationBar from '../components/navigation_bar'; - -const mapStateToProps = (state, props) => ({ - account: state.getIn(['accounts', state.getIn(['meta', 'me'])]) -}); - -export default connect(mapStateToProps)(NavigationBar); diff --git a/app/assets/javascripts/components/features/ui/containers/upload_form_container.jsx b/app/assets/javascripts/components/features/ui/containers/upload_form_container.jsx deleted file mode 100644 index 6554f944f..000000000 --- a/app/assets/javascripts/components/features/ui/containers/upload_form_container.jsx +++ /dev/null @@ -1,25 +0,0 @@ -import { connect } from 'react-redux'; -import UploadForm from '../components/upload_form'; -import { uploadCompose, undoUploadCompose } from '../../../actions/compose'; - -const mapStateToProps = function (state, props) { - return { - media: state.getIn(['compose', 'media_attachments']), - progress: state.getIn(['compose', 'progress']), - is_uploading: state.getIn(['compose', 'is_uploading']) - }; -}; - -const mapDispatchToProps = function (dispatch) { - return { - onSelectFile: function (files) { - dispatch(uploadCompose(files)); - }, - - onRemoveFile: function (media_id) { - dispatch(undoUploadCompose(media_id)); - } - } -}; - -export default connect(mapStateToProps, mapDispatchToProps)(UploadForm); -- cgit