Remove unused code
This commit is contained in:
parent
935dd12520
commit
59469d9f85
3 changed files with 2 additions and 68 deletions
|
@ -26,8 +26,6 @@ class CollectionListRowBase extends React.Component {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
optionsOpen: false,
|
optionsOpen: false,
|
||||||
renameOpen: false,
|
|
||||||
renameValue: props.collection.name,
|
|
||||||
isFocused: false
|
isFocused: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -65,69 +63,17 @@ class CollectionListRowBase extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
openRename = () => {
|
|
||||||
this.setState({
|
|
||||||
renameOpen: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
closeRename = () => {
|
|
||||||
this.setState({
|
|
||||||
renameOpen: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
closeAll = () => {
|
closeAll = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
renameOpen: false,
|
|
||||||
optionsOpen: 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 = () => {
|
handleDropdownOpen = () => {
|
||||||
this.closeAll();
|
this.closeAll();
|
||||||
this.openOptions();
|
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 = () => {
|
handleCollectionDelete = () => {
|
||||||
this.closeAll();
|
this.closeAll();
|
||||||
if (window.confirm(`Are you sure you want to delete "${this.props.collection.name}"?`)) {
|
if (window.confirm(`Are you sure you want to delete "${this.props.collection.name}"?`)) {
|
||||||
|
@ -278,11 +224,7 @@ CollectionListRowBase.propTypes = {
|
||||||
username: PropTypes.string,
|
username: PropTypes.string,
|
||||||
authenticated: PropTypes.bool.isRequired
|
authenticated: PropTypes.bool.isRequired
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
deleteCollection: PropTypes.func.isRequired,
|
deleteCollection: PropTypes.func.isRequired
|
||||||
showShareModal: PropTypes.func.isRequired,
|
|
||||||
cloneProject: PropTypes.func.isRequired,
|
|
||||||
exportProjectAsZip: PropTypes.func.isRequired,
|
|
||||||
changeProjectName: PropTypes.func.isRequired
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function mapDispatchToPropsSketchListRow(dispatch) {
|
function mapDispatchToPropsSketchListRow(dispatch) {
|
||||||
|
|
|
@ -154,7 +154,7 @@ class SketchListRowBase extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleRowClick = () => {
|
handleRowClick = (evt) => {
|
||||||
if (!this.props.addMode) {
|
if (!this.props.addMode) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
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 Nav from '../../../components/Nav';
|
||||||
|
|
||||||
import CollectionCreate from '../components/CollectionCreate';
|
import CollectionCreate from '../components/CollectionCreate';
|
||||||
|
@ -69,16 +66,12 @@ class CollectionView extends React.Component {
|
||||||
|
|
||||||
function mapStateToProps(state) {
|
function mapStateToProps(state) {
|
||||||
return {
|
return {
|
||||||
previousPath: state.ide.previousPath,
|
|
||||||
user: state.user,
|
user: state.user,
|
||||||
theme: state.preferences.theme
|
theme: state.preferences.theme
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapDispatchToProps(dispatch) {
|
function mapDispatchToProps(dispatch) {
|
||||||
return bindActionCreators({
|
|
||||||
updateSettings, initiateVerification, createApiKey, removeApiKey
|
|
||||||
}, dispatch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CollectionView.propTypes = {
|
CollectionView.propTypes = {
|
||||||
|
@ -89,7 +82,6 @@ CollectionView.propTypes = {
|
||||||
collection_id: PropTypes.string.isRequired,
|
collection_id: PropTypes.string.isRequired,
|
||||||
username: PropTypes.string.isRequired,
|
username: PropTypes.string.isRequired,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
// previousPath: PropTypes.string.isRequired,
|
|
||||||
theme: PropTypes.string.isRequired,
|
theme: PropTypes.string.isRequired,
|
||||||
user: PropTypes.shape({
|
user: PropTypes.shape({
|
||||||
username: PropTypes.string.isRequired,
|
username: PropTypes.string.isRequired,
|
||||||
|
|
Loading…
Reference in a new issue