Remove unused code

This commit is contained in:
Andrew Nicolaou 2019-10-21 10:14:55 +02:00
parent 935dd12520
commit 59469d9f85
3 changed files with 2 additions and 68 deletions

View File

@ -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) {

View File

@ -154,7 +154,7 @@ class SketchListRowBase extends React.Component {
}
}
handleRowClick = () => {
handleRowClick = (evt) => {
if (!this.props.addMode) {
return;
}

View File

@ -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,