Skip to content
Snippets Groups Projects
Commit 5251b07e authored by Ray Schamp's avatar Ray Schamp
Browse files

Add "stop" skeleton component

parent 06ca90c8
Branches
Tags
No related merge requests found
......@@ -12,14 +12,19 @@ class GreenFlag extends React.Component {
render () {
return (
<div className="scratch-green-flag">
<button onClick={this.onClick}></button>
<button onClick={this.onClick}>{this.props.title}</button>
</div>
);
}
}
GreenFlag.propTypes = {
title: React.PropTypes.string,
vm: React.PropTypes.object
};
GreenFlag.defaultProps = {
title: 'Go'
};
module.exports = GreenFlag;
......@@ -5,6 +5,7 @@ const GreenFlag = require('./green-flag');
const Renderer = require('scratch-render');
const SpriteSelector = require('./sprite-selector');
const Stage = require('./stage');
const StopAll = require('./stop-all');
const Toolbox = require('./toolbox');
const VM = require('scratch-vm');
const VMManager = require('../lib/vm-manager');
......@@ -40,6 +41,7 @@ class GUI extends React.Component {
return (
<div className="scratch-gui">
<GreenFlag vm={this.props.vm} />
<StopAll vm={this.props.vm} />
<Stage stageRef={stage => this.stage = stage} />
<SpriteSelector vm={this.props.vm} />
<Toolbox toolboxRef={toolbox => this.toolbox = toolbox} />
......
const React = require('react');
class StopAll extends React.Component {
constructor (props) {
super(props);
this.onClick = this.onClick.bind(this);
}
onClick (e) {
e.preventDefault();
this.props.vm.stopAll();
}
render () {
return (
<div className="scratch-stop-all">
<button onClick={this.onClick}>{this.props.title}</button>
</div>
);
}
}
StopAll.propTypes = {
title: React.PropTypes.string,
vm: React.PropTypes.object
};
StopAll.defaultProps = {
title: 'Stop'
};
module.exports = StopAll;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment