p5.js-web-editor/shared/components/Toolbar/Toolbar.jsx

26 lines
694 B
React
Raw Normal View History

2016-05-11 17:19:37 +00:00
import React from 'react';
2016-05-12 21:22:54 +00:00
var Isvg = require('react-inlinesvg');
2016-05-11 17:19:37 +00:00
var playUrl = require('../../../images/play.svg');
var logoUrl = require('../../../images/p5js-logo.svg');
2016-05-12 21:22:54 +00:00
var stopUrl = require('../../../images/stop.svg');
2016-05-11 17:19:37 +00:00
class Toolbar extends React.Component {
render() {
return (
<div className="toolbar">
<img className="toolbar__logo" src={logoUrl}/>
2016-05-11 20:13:17 +00:00
<div className="toolbar__play-button" onClick={this.props.toggleSketch}>
2016-05-12 21:22:54 +00:00
<Isvg src={playUrl} alt="Play Sketch" />
</div>
2016-05-12 21:22:54 +00:00
{ this.props.isPlaying ?
<div className="toolbar__stop-button">
<Isvg src={stopUrl} alt="Stop Sketch" />
</div>
: null }
2016-05-11 17:19:37 +00:00
</div>
);
}
}
export default Toolbar;