From ecaee9877eddb2e67e84ce2016a60de74394f353 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 15 Aug 2017 10:30:27 -0400 Subject: [PATCH] Add green flag and stop buttons to blocks example Add class name props to the components, and fix positioning for the green flag to be reusable. --- src/components/green-flag/green-flag.css | 3 +-- src/components/green-flag/green-flag.jsx | 13 +++++++++---- src/components/gui/gui.css | 4 ++++ src/components/gui/gui.jsx | 5 ++++- src/components/stop-all/stop-all.jsx | 13 +++++++++---- src/examples/blocks-only.css | 14 ++++++++++++-- src/examples/blocks-only.jsx | 8 +++++++- 7 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/components/green-flag/green-flag.css b/src/components/green-flag/green-flag.css index 07e57621b..3fda3a207 100644 --- a/src/components/green-flag/green-flag.css +++ b/src/components/green-flag/green-flag.css @@ -2,10 +2,9 @@ width: 1.1rem; height: 1.1rem; opacity: 0.5; - margin: 0.25rem 0.6rem; user-select: none; cursor: pointer; - transition: opacity 0.2s ease-out; /* @todo: standardize with var */ + transition: opacity 0.2s ease-out; /* @todo: standardize with var */ } .green-flag.is-active, diff --git a/src/components/green-flag/green-flag.jsx b/src/components/green-flag/green-flag.jsx index 692a347cd..6b8733c1d 100644 --- a/src/components/green-flag/green-flag.jsx +++ b/src/components/green-flag/green-flag.jsx @@ -8,16 +8,20 @@ import styles from './green-flag.css'; const GreenFlagComponent = function (props) { const { active, + className, onClick, title, ...componentProps } = props; return ( { - + diff --git a/src/components/stop-all/stop-all.jsx b/src/components/stop-all/stop-all.jsx index aba3ed424..f2916f605 100644 --- a/src/components/stop-all/stop-all.jsx +++ b/src/components/stop-all/stop-all.jsx @@ -8,16 +8,20 @@ import styles from './stop-all.css'; const StopAllComponent = function (props) { const { active, + className, onClick, title, ...componentProps } = props; return ( ({vm: state.vm}); + const VMBlocks = connect(mapStateToProps)(Blocks); +const VMGreenFlag = connect(mapStateToProps)(GreenFlag); +const VMStopAll = connect(mapStateToProps)(StopAll); const BlocksOnly = props => ( @@ -20,13 +25,14 @@ const BlocksOnly = props => ( media: `static/blocks-media/` }} /> + + ); const App = AppStateHOC(ProjectLoaderHOC(BlocksOnly)); const appTarget = document.createElement('div'); -appTarget.className = styles.app; document.body.appendChild(appTarget); ReactDOM.render(, appTarget);