From a70c6c91af752db44d4fb4b1e7fe04286ea5d907 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 23 Mar 2021 15:00:26 -0500 Subject: [PATCH] Delete unused Compose code --- .../compose/components/navigation_bar.js | 42 ------ .../containers/navigation_container.js | 11 -- app/soapbox/features/compose/index.js | 123 ------------------ .../features/ui/util/async-components.js | 4 - 4 files changed, 180 deletions(-) delete mode 100644 app/soapbox/features/compose/components/navigation_bar.js delete mode 100644 app/soapbox/features/compose/containers/navigation_container.js delete mode 100644 app/soapbox/features/compose/index.js diff --git a/app/soapbox/features/compose/components/navigation_bar.js b/app/soapbox/features/compose/components/navigation_bar.js deleted file mode 100644 index 435bd5ee9..000000000 --- a/app/soapbox/features/compose/components/navigation_bar.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import ActionBar from './action_bar'; -import Avatar from '../../../components/avatar'; -import Permalink from '../../../components/permalink'; -import IconButton from '../../../components/icon_button'; -import { FormattedMessage } from 'react-intl'; -import ImmutablePureComponent from 'react-immutable-pure-component'; - -export default class NavigationBar extends ImmutablePureComponent { - - static propTypes = { - account: ImmutablePropTypes.map.isRequired, - onClose: PropTypes.func, - }; - - render() { - return ( -
- - {this.props.account.get('acct')} - - - -
- - @{this.props.account.get('acct')} - - - -
- -
- - -
-
- ); - } - -} diff --git a/app/soapbox/features/compose/containers/navigation_container.js b/app/soapbox/features/compose/containers/navigation_container.js deleted file mode 100644 index 31a9b4285..000000000 --- a/app/soapbox/features/compose/containers/navigation_container.js +++ /dev/null @@ -1,11 +0,0 @@ -import { connect } from 'react-redux'; -import NavigationBar from '../components/navigation_bar'; - -const mapStateToProps = state => { - const me = state.get('me'); - return { - account: state.getIn(['accounts', me]), - }; -}; - -export default connect(mapStateToProps)(NavigationBar); diff --git a/app/soapbox/features/compose/index.js b/app/soapbox/features/compose/index.js deleted file mode 100644 index c66c5b82a..000000000 --- a/app/soapbox/features/compose/index.js +++ /dev/null @@ -1,123 +0,0 @@ -import React from 'react'; -import ComposeFormContainer from './containers/compose_form_container'; -import NavigationContainer from './containers/navigation_container'; -import PropTypes from 'prop-types'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import { connect } from 'react-redux'; -import { mountCompose, unmountCompose } from '../../actions/compose'; -import { Link } from 'react-router-dom'; -import { injectIntl, defineMessages } from 'react-intl'; -import SearchContainer from './containers/search_container'; -import Motion from '../ui/util/optional_motion'; -import spring from 'react-motion/lib/spring'; -import SearchResultsContainer from './containers/search_results_container'; -import { changeComposing } from '../../actions/compose'; -import Icon from 'soapbox/components/icon'; -import { getSettings } from 'soapbox/actions/settings'; - -const messages = defineMessages({ - start: { id: 'getting_started.heading', defaultMessage: 'Getting started' }, - home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' }, - notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' }, - public: { id: 'navigation_bar.public_timeline', defaultMessage: 'Federated timeline' }, - community: { id: 'navigation_bar.community_timeline', defaultMessage: 'Local timeline' }, - preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' }, - logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' }, - compose: { id: 'navigation_bar.compose', defaultMessage: 'Compose new post' }, -}); - -const mapStateToProps = (state, ownProps) => ({ - columns: getSettings(state).get('columns'), - showSearch: ownProps.multiColumn ? state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']) : ownProps.isSearchPage, -}); - -export default @connect(mapStateToProps) -@injectIntl -class Compose extends React.PureComponent { - - static propTypes = { - dispatch: PropTypes.func.isRequired, - columns: ImmutablePropTypes.list.isRequired, - multiColumn: PropTypes.bool, - showSearch: PropTypes.bool, - isSearchPage: PropTypes.bool, - intl: PropTypes.object.isRequired, - }; - - componentDidMount() { - const { isSearchPage } = this.props; - - if (!isSearchPage) { - this.props.dispatch(mountCompose()); - } - } - - componentWillUnmount() { - const { isSearchPage } = this.props; - - if (!isSearchPage) { - this.props.dispatch(unmountCompose()); - } - } - - onFocus = () => { - this.props.dispatch(changeComposing(true)); - } - - onBlur = () => { - this.props.dispatch(changeComposing(false)); - } - - render() { - const { multiColumn, showSearch, isSearchPage, intl } = this.props; - - let header = ''; - - if (multiColumn) { - const { columns } = this.props; - header = ( - - ); - } - - return ( -
- {header} - - {(multiColumn || isSearchPage) && } - -
- {!isSearchPage &&
- - -
} - - - {({ x }) => ( -
- -
- )} -
-
-
- ); - } - -} diff --git a/app/soapbox/features/ui/util/async-components.js b/app/soapbox/features/ui/util/async-components.js index 899e7ef74..cc5566937 100644 --- a/app/soapbox/features/ui/util/async-components.js +++ b/app/soapbox/features/ui/util/async-components.js @@ -2,10 +2,6 @@ export function EmojiPicker() { return import(/* webpackChunkName: "emoji_picker" */'../../emoji/emoji_picker'); } -export function Compose() { - return import(/* webpackChunkName: "features/compose" */'../../compose'); -} - export function Notifications() { return import(/* webpackChunkName: "features/notifications" */'../../notifications'); }