diff --git a/src/components/CodeViewer.js b/src/components/CodeViewer.js index caa920b..85b5950 100644 --- a/src/components/CodeViewer.js +++ b/src/components/CodeViewer.js @@ -7,7 +7,7 @@ class CodeViewer extends Component { render() { return ( -
+
{this.props.arduino}

{this.props.xml}

diff --git a/src/components/Home.js b/src/components/Home.js index 9d8f30b..8638b6d 100644 --- a/src/components/Home.js +++ b/src/components/Home.js @@ -3,23 +3,40 @@ import React, { Component } from 'react'; import WorkspaceStats from './WorkspaceStats'; import WorkspaceFunc from './WorkspaceFunc'; import BlocklyWindow from './Blockly/BlocklyWindow'; +import CodeViewer from './CodeViewer'; import Grid from '@material-ui/core/Grid'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import Switch from '@material-ui/core/Switch'; class Home extends Component { + state = { + codeOn: false + } + + onChange = () => { + this.setState({ codeOn: !this.state.codeOn }); + } render() { return (
- + + } + label="Code" + /> - -
-
+ {this.state.codeOn ? + + + + : null}