Cleanup render functions

- remove unused imports
- remove unneeded comments
- onbeforeunload is handled by project-saver-hoc
This commit is contained in:
Thomas Weber committed 2020-09-01 23:42:01 -05:00
1 parent 6387816ceb
commit f7ffca055b
2 files changed
-18

No files matched your search

-9
View File
@@ -1,21 +1,12 @@
import PropTypes from 'prop-types';
import React from 'react';
import {connect} from 'react-redux';
import {compose} from 'redux';
import GUI from '../containers/gui.jsx';
import TWParserHOC from '../lib/tw-parser-hoc.jsx';
import AppStateHOC from '../lib/app-state-hoc.jsx';
const onClickLogo = () => {
// remove the hash to load the default project
location.hash = '';
};
if (process.env.NODE_ENV === 'production' && typeof window === 'object') {
// Warn before navigating away
window.onbeforeunload = () => true;
}
const searchParams = new URLSearchParams(location.search);
const cloudHost = searchParams.get('cloud_host') || 'wss://clouddata.turbowarp.org';
-9
View File
@@ -16,15 +16,9 @@ import Examples from '../components/tw-examples/examples.jsx';
import styles from './gui.css';
const onClickLogo = () => {
// remove the hash to load the default project
location.hash = '';
};
if (process.env.NODE_ENV === 'production' && typeof window === 'object') {
// Warn before navigating away
window.onbeforeunload = () => true;
}
const Interface = ({isPlayerOnly}) => (
<div className={classNames(isPlayerOnly ? styles.stageOnly : styles.editor)}>
{isPlayerOnly ? (
@@ -70,9 +64,6 @@ const ConnectedInterface = connect(
mapDispatchToProps
)(Interface);
// note that redux's 'compose' function is just being used as a general utility to make
// the hierarchy of HOC constructor calls clearer here; it has nothing to do with redux's
// ability to compose reducers.
const WrappedInterface = compose(
AppStateHOC,
TWParserHOC