From 82edcc4bd8f68a770a5c23ccf83d199c8e9515be Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 10 Sep 2022 12:04:08 -0500 Subject: [PATCH 1/4] Delete unused "introduction" feature --- app/soapbox/features/introduction/index.js | 172 --------------------- 1 file changed, 172 deletions(-) delete mode 100644 app/soapbox/features/introduction/index.js diff --git a/app/soapbox/features/introduction/index.js b/app/soapbox/features/introduction/index.js deleted file mode 100644 index a35ba341a..000000000 --- a/app/soapbox/features/introduction/index.js +++ /dev/null @@ -1,172 +0,0 @@ -import classNames from 'clsx'; -import PropTypes from 'prop-types'; -import React from 'react'; -import { FormattedMessage } from 'react-intl'; -import { connect } from 'react-redux'; -import ReactSwipeableViews from 'react-swipeable-views'; - -import { closeOnboarding } from '../../actions/onboarding'; - -const FrameWelcome = ({ domain, onNext }) => ( -
-
-

-

{domain} }} />

-
- -
- -
-
-); - -FrameWelcome.propTypes = { - domain: PropTypes.string.isRequired, - onNext: PropTypes.func.isRequired, -}; - -const FrameFederation = ({ onNext }) => ( -
-
-
-

-

-
-
- -
- -
-
-); - -FrameFederation.propTypes = { - onNext: PropTypes.func.isRequired, -}; - -const FrameInteractions = ({ onNext }) => ( -
-
-
-

-

-
- -
-

-

-
- -
-

-

-
-
- -
- -
-
-); - -FrameInteractions.propTypes = { - onNext: PropTypes.func.isRequired, -}; - -export default @connect(state => ({ domain: state.getIn(['meta', 'domain']) })) -class Introduction extends React.PureComponent { - - static propTypes = { - domain: PropTypes.string.isRequired, - dispatch: PropTypes.func.isRequired, - }; - - state = { - currentIndex: 0, - }; - - constructor(props) { - super(props); - this.pages = [ - , - , - , - ]; - } - - componentDidMount() { - window.addEventListener('keyup', this.handleKeyUp); - } - - componentWillUnmount() { - window.addEventListener('keyup', this.handleKeyUp); - } - - handleDot = (e) => { - const i = Number(e.currentTarget.getAttribute('data-index')); - e.preventDefault(); - this.setState({ currentIndex: i }); - } - - handlePrev = () => { - this.setState(({ currentIndex }) => ({ - currentIndex: Math.max(0, currentIndex - 1), - })); - } - - handleNext = () => { - const { pages } = this; - - this.setState(({ currentIndex }) => ({ - currentIndex: Math.min(currentIndex + 1, pages.length - 1), - })); - } - - handleSwipe = (index) => { - this.setState({ currentIndex: index }); - } - - handleFinish = () => { - this.props.dispatch(closeOnboarding()); - } - - handleKeyUp = ({ key }) => { - switch (key) { - case 'ArrowLeft': - this.handlePrev(); - break; - case 'ArrowRight': - this.handleNext(); - break; - } - } - - render() { - const { currentIndex } = this.state; - const { pages } = this; - - return ( -
- - {pages.map((page, i) => ( -
{page}
- ))} -
- -
- {pages.map((_, i) => ( -
- ))} -
-
- ); - } - -} From bcfbc394ab39adb1c6929942aee0d8d11be6ea4b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 10 Sep 2022 12:05:38 -0500 Subject: [PATCH 2/4] Delete Groups components --- app/soapbox/features/groups/create/index.js | 116 -------------- app/soapbox/features/groups/edit/index.js | 148 ------------------ app/soapbox/features/groups/index/card.js | 57 ------- app/soapbox/features/groups/index/index.js | 93 ----------- app/soapbox/features/groups/members/index.js | 76 --------- .../features/groups/removed_accounts/index.js | 94 ----------- .../features/groups/sidebar_panel/index.js | 53 ------- .../features/groups/sidebar_panel/item.js | 48 ------ .../groups/timeline/components/header.js | 92 ----------- .../groups/timeline/components/panel.js | 38 ----- .../timeline/containers/header_container.js | 21 --- app/soapbox/features/groups/timeline/index.js | 107 ------------- .../features/ui/util/async-components.ts | 24 --- app/soapbox/pages/group_page.js | 75 --------- app/soapbox/pages/groups_page.js | 60 ------- 15 files changed, 1102 deletions(-) delete mode 100644 app/soapbox/features/groups/create/index.js delete mode 100644 app/soapbox/features/groups/edit/index.js delete mode 100644 app/soapbox/features/groups/index/card.js delete mode 100644 app/soapbox/features/groups/index/index.js delete mode 100644 app/soapbox/features/groups/members/index.js delete mode 100644 app/soapbox/features/groups/removed_accounts/index.js delete mode 100644 app/soapbox/features/groups/sidebar_panel/index.js delete mode 100644 app/soapbox/features/groups/sidebar_panel/item.js delete mode 100644 app/soapbox/features/groups/timeline/components/header.js delete mode 100644 app/soapbox/features/groups/timeline/components/panel.js delete mode 100644 app/soapbox/features/groups/timeline/containers/header_container.js delete mode 100644 app/soapbox/features/groups/timeline/index.js delete mode 100644 app/soapbox/pages/group_page.js delete mode 100644 app/soapbox/pages/groups_page.js diff --git a/app/soapbox/features/groups/create/index.js b/app/soapbox/features/groups/create/index.js deleted file mode 100644 index d7189baa4..000000000 --- a/app/soapbox/features/groups/create/index.js +++ /dev/null @@ -1,116 +0,0 @@ -import classNames from 'clsx'; -import PropTypes from 'prop-types'; -import React from 'react'; -import { defineMessages, injectIntl } from 'react-intl'; -import { connect } from 'react-redux'; -import { withRouter } from 'react-router-dom'; - -import { changeValue, submit, reset } from '../../../actions/group_editor'; - -const messages = defineMessages({ - title: { id: 'groups.form.title', defaultMessage: 'Enter a new group title' }, - description: { id: 'groups.form.description', defaultMessage: 'Enter the group description' }, - coverImage: { id: 'groups.form.coverImage', defaultMessage: 'Upload a banner image' }, - coverImageChange: { id: 'groups.form.coverImageChange', defaultMessage: 'Banner image selected' }, - create: { id: 'groups.form.create', defaultMessage: 'Create group' }, -}); - -const mapStateToProps = state => ({ - title: state.getIn(['group_editor', 'title']), - description: state.getIn(['group_editor', 'description']), - coverImage: state.getIn(['group_editor', 'coverImage']), - disabled: state.getIn(['group_editor', 'isSubmitting']), -}); - -const mapDispatchToProps = dispatch => ({ - onTitleChange: value => dispatch(changeValue('title', value)), - onDescriptionChange: value => dispatch(changeValue('description', value)), - onCoverImageChange: value => dispatch(changeValue('coverImage', value)), - onSubmit: routerHistory => dispatch(submit(routerHistory)), - reset: () => dispatch(reset()), -}); - -export default @connect(mapStateToProps, mapDispatchToProps) -@injectIntl -@withRouter -class Create extends React.PureComponent { - - static propTypes = { - title: PropTypes.string.isRequired, - description: PropTypes.string.isRequired, - coverImage: PropTypes.object, - disabled: PropTypes.bool, - intl: PropTypes.object.isRequired, - onTitleChange: PropTypes.func.isRequired, - onSubmit: PropTypes.func.isRequired, - reset: PropTypes.func.isRequired, - onDescriptionChange: PropTypes.func.isRequired, - onCoverImageChange: PropTypes.func.isRequired, - history: PropTypes.object, - }; - - constructor(props) { - super(props); - props.reset(); - } - - handleTitleChange = e => { - this.props.onTitleChange(e.target.value); - } - - handleDescriptionChange = e => { - this.props.onDescriptionChange(e.target.value); - } - - handleCoverImageChange = e => { - this.props.onCoverImageChange(e.target.files[0]); - } - - handleSubmit = e => { - e.preventDefault(); - this.props.onSubmit(this.props.history); - } - - render() { - const { title, description, coverImage, disabled, intl } = this.props; - - return ( -
-
- -
-
-