From 59469d9f852363fe1d316c086ef3f02dec678f55 Mon Sep 17 00:00:00 2001 From: Andrew Nicolaou Date: Mon, 21 Oct 2019 10:14:55 +0200 Subject: [PATCH] Remove unused code --- .../CollectionList/CollectionListRow.jsx | 60 +------------------ client/modules/IDE/components/SketchList.jsx | 2 +- client/modules/User/pages/CollectionView.jsx | 8 --- 3 files changed, 2 insertions(+), 68 deletions(-) diff --git a/client/modules/IDE/components/CollectionList/CollectionListRow.jsx b/client/modules/IDE/components/CollectionList/CollectionListRow.jsx index 066754db..ef94e40c 100644 --- a/client/modules/IDE/components/CollectionList/CollectionListRow.jsx +++ b/client/modules/IDE/components/CollectionList/CollectionListRow.jsx @@ -26,8 +26,6 @@ class CollectionListRowBase extends React.Component { super(props); this.state = { optionsOpen: false, - renameOpen: false, - renameValue: props.collection.name, isFocused: false }; } @@ -65,69 +63,17 @@ class CollectionListRowBase extends React.Component { } } - openRename = () => { - this.setState({ - renameOpen: true - }); - } - - closeRename = () => { - this.setState({ - renameOpen: false - }); - } - closeAll = () => { this.setState({ - renameOpen: false, optionsOpen: false }); } - handleRenameChange = (e) => { - this.setState({ - renameValue: e.target.value - }); - } - - handleRenameEnter = (e) => { - if (e.key === 'Enter') { - // TODO pass this func - this.props.changeProjectName(this.props.collection.id, this.state.renameValue); - this.closeAll(); - } - } - - resetSketchName = () => { - this.setState({ - renameValue: this.props.collection.name - }); - } - handleDropdownOpen = () => { this.closeAll(); this.openOptions(); } - handleRenameOpen = () => { - this.closeAll(); - this.openRename(); - } - - handleSketchDownload = () => { - this.props.exportProjectAsZip(this.props.collection.id); - } - - handleSketchDuplicate = () => { - this.closeAll(); - this.props.cloneProject(this.props.collection.id); - } - - handleSketchShare = () => { - this.closeAll(); - this.props.showShareModal(this.props.collection.id, this.props.collection.name, this.props.username); - } - handleCollectionDelete = () => { this.closeAll(); if (window.confirm(`Are you sure you want to delete "${this.props.collection.name}"?`)) { @@ -278,11 +224,7 @@ CollectionListRowBase.propTypes = { username: PropTypes.string, authenticated: PropTypes.bool.isRequired }).isRequired, - deleteCollection: PropTypes.func.isRequired, - showShareModal: PropTypes.func.isRequired, - cloneProject: PropTypes.func.isRequired, - exportProjectAsZip: PropTypes.func.isRequired, - changeProjectName: PropTypes.func.isRequired + deleteCollection: PropTypes.func.isRequired }; function mapDispatchToPropsSketchListRow(dispatch) { diff --git a/client/modules/IDE/components/SketchList.jsx b/client/modules/IDE/components/SketchList.jsx index 099b0c65..f472d181 100644 --- a/client/modules/IDE/components/SketchList.jsx +++ b/client/modules/IDE/components/SketchList.jsx @@ -154,7 +154,7 @@ class SketchListRowBase extends React.Component { } } - handleRowClick = () => { + handleRowClick = (evt) => { if (!this.props.addMode) { return; } diff --git a/client/modules/User/pages/CollectionView.jsx b/client/modules/User/pages/CollectionView.jsx index 145e96c2..c402539c 100644 --- a/client/modules/User/pages/CollectionView.jsx +++ b/client/modules/User/pages/CollectionView.jsx @@ -1,9 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; import { connect } from 'react-redux'; -import { bindActionCreators } from 'redux'; -import { browserHistory } from 'react-router'; -import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions'; import Nav from '../../../components/Nav'; import CollectionCreate from '../components/CollectionCreate'; @@ -69,16 +66,12 @@ class CollectionView extends React.Component { function mapStateToProps(state) { return { - previousPath: state.ide.previousPath, user: state.user, theme: state.preferences.theme }; } function mapDispatchToProps(dispatch) { - return bindActionCreators({ - updateSettings, initiateVerification, createApiKey, removeApiKey - }, dispatch); } CollectionView.propTypes = { @@ -89,7 +82,6 @@ CollectionView.propTypes = { collection_id: PropTypes.string.isRequired, username: PropTypes.string.isRequired, }).isRequired, - // previousPath: PropTypes.string.isRequired, theme: PropTypes.string.isRequired, user: PropTypes.shape({ username: PropTypes.string.isRequired,