🧹 remove console props from MobilePreview

This commit is contained in:
ghalestrilo 2020-07-15 18:26:34 -03:00
parent dd1141bfbc
commit 0c0fceee1a
2 changed files with 22 additions and 29 deletions

View file

@ -154,27 +154,29 @@ ConsoleComponent.defaultProps = {
consoleEvents: []
};
// const Console = () => {
// const consoleEvents = useSelector(state => state.console);
// const { consoleIsExpanded } = useSelector(state => state.ide);
// const { theme, fontSize } = useSelector(state => state.preferences);
// TODO: Use Hooks implementation. Requires react-redux 7.1.0
/*
const Console = () => {
const consoleEvents = useSelector(state => state.console);
const { consoleIsExpanded } = useSelector(state => state.ide);
const { theme, fontSize } = useSelector(state => state.preferences);
// const dispatch = useDispatch();
// return (
// <ConsoleComponent
// consoleEvents={consoleEvents}
// isExpanded={consoleIsExpanded}
// theme={theme}
// fontSize={fontSize}
// collapseConsole={() => dispatch({})}
// expandConsole={() => dispatch({})}
// clearConsole={() => dispatch({})}
// dispatchConsoleEvent={() => dispatch({})}
// />
// );
// };
const dispatch = useDispatch();
return (
<ConsoleComponent
consoleEvents={consoleEvents}
isExpanded={consoleIsExpanded}
theme={theme}
fontSize={fontSize}
collapseConsole={() => dispatch({})}
expandConsole={() => dispatch({})}
clearConsole={() => dispatch({})}
dispatchConsoleEvent={() => dispatch({})}
/>
);
};
*/
const Console = connect(
state => ({

View file

@ -41,16 +41,13 @@ const MobileSketchView = (props) => {
// Actions
const {
setTextOutput, setGridOutput, setSoundOutput,
endSketchRefresh, stopSketch, console,
endSketchRefresh, stopSketch,
dispatchConsoleEvent, expandConsole, clearConsole,
setBlobUrl,
} = props;
const { preferences, ide } = props;
// FIXME:
const collapseConsole = () => {};
return (
<Screen fullscreen>
<Header
@ -165,11 +162,6 @@ MobileSketchView.propTypes = {
setBlobUrl: PropTypes.func.isRequired,
expandConsole: PropTypes.func.isRequired,
clearConsole: PropTypes.func.isRequired,
console: PropTypes.arrayOf(PropTypes.shape({
method: PropTypes.string.isRequired,
args: PropTypes.arrayOf(PropTypes.string)
})).isRequired,
};
function mapStateToProps(state) {
@ -179,7 +171,6 @@ function mapStateToProps(state) {
files: state.files,
ide: state.ide,
preferences: state.preferences,
console: state.console,
selectedFile: state.files.find(file => file.isSelectedFile) ||
state.files.find(file => file.name === 'sketch.js') ||
state.files.find(file => file.name !== 'root'),