From 8187865f1f9548074727666a9c61854813497237 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sat, 12 Jan 2019 12:32:00 -0500 Subject: [PATCH] Renaming SVG to Render --- src/components/App/index.js | 5 ++--- src/components/{SVG => Render}/index.js | 8 ++++++-- src/components/{SVG => Render}/style.module.css | 0 3 files changed, 8 insertions(+), 5 deletions(-) rename src/components/{SVG => Render}/index.js (81%) rename src/components/{SVG => Render}/style.module.css (100%) diff --git a/src/components/App/index.js b/src/components/App/index.js index ef53241..096e198 100644 --- a/src/components/App/index.js +++ b/src/components/App/index.js @@ -4,13 +4,12 @@ import { AppContextProvider } from 'components/AppContext'; import Form from 'components/Form'; import Loader from 'components/Loader'; import Message from 'components/Message'; -import SVG from 'components/SVG'; +import Render from 'components/Render'; class App extends React.PureComponent { state={} handleRender = ({ syntax, expr }) => { - console.log('Render:', syntax, expr); // eslint-disable-line no-console this.setState({ syntax, expr }); } @@ -30,7 +29,7 @@ class App extends React.PureComponent { Retry - + ; } } diff --git a/src/components/SVG/index.js b/src/components/Render/index.js similarity index 81% rename from src/components/SVG/index.js rename to src/components/Render/index.js index e7caa56..d76f67a 100644 --- a/src/components/SVG/index.js +++ b/src/components/Render/index.js @@ -6,7 +6,7 @@ import style from './style.module.css'; import AppContext from 'components/AppContext'; -class SVG extends React.PureComponent { +class Render extends React.PureComponent { static contextType = AppContext svgContainer = React.createRef() @@ -33,6 +33,10 @@ class SVG extends React.PureComponent { } render() { + const { syntax, expr } = this.context; + + console.log('Render:', syntax, expr); // eslint-disable-line no-console + // Demo rendering for now return
@@ -40,4 +44,4 @@ class SVG extends React.PureComponent { } } -export default SVG; +export default Render; diff --git a/src/components/SVG/style.module.css b/src/components/Render/style.module.css similarity index 100% rename from src/components/SVG/style.module.css rename to src/components/Render/style.module.css