♻️ dry up <MobileIDEView /> imports

This commit is contained in:
ghalestrilo 2020-08-12 11:31:37 -03:00
parent 06f9050a47
commit f9fdadbe52

View file

@ -8,14 +8,8 @@ import styled from 'styled-components';
// Imports to be Refactored // Imports to be Refactored
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import * as FileActions from '../actions/files';
import * as IDEActions from '../actions/ide'; import * as IDEActions from '../actions/ide';
import * as ProjectActions from '../actions/project'; import * as ProjectActions from '../actions/project';
import * as PreferencesActions from '../actions/preferences';
import * as UserActions from '../../User/actions';
import * as ToastActions from '../actions/toast';
import * as ConsoleActions from '../actions/console';
import { getHTMLFile } from '../reducers/files';
// Local Imports // Local Imports
import Editor from '../components/Editor'; import Editor from '../components/Editor';
@ -182,12 +176,10 @@ MobileIDEView.propTypes = {
function mapStateToProps(state) { function mapStateToProps(state) {
return { return {
files: state.files,
selectedFile: selectedFile:
state.files.find(file => file.isSelectedFile) || state.files.find(file => file.isSelectedFile) ||
state.files.find(file => file.name === 'sketch.js') || state.files.find(file => file.name === 'sketch.js') ||
state.files.find(file => file.name !== 'root'), state.files.find(file => file.name !== 'root'),
htmlFile: getHTMLFile(state.files),
ide: state.ide, ide: state.ide,
unsavedChanges: state.ide.unsavedChanges, unsavedChanges: state.ide.unsavedChanges,
preferences: state.preferences, preferences: state.preferences,
@ -198,15 +190,9 @@ function mapStateToProps(state) {
}; };
} }
function mapDispatchToProps(dispatch) { const mapDispatchToProps = dispatch => bindActionCreators({
return bindActionCreators( ...ProjectActions,
Object.assign( ...IDEActions
{}, }, dispatch);
ProjectActions,
IDEActions,
),
dispatch
);
}
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(MobileIDEView)); export default withRouter(connect(mapStateToProps, mapDispatchToProps)(MobileIDEView));