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');
|
2016-05-11 19:31:17 +00:00
|
|
|
var logoUrl = require('../../../images/p5js-logo.svg');
|
2016-05-12 21:22:54 +00:00
|
|
|
var stopUrl = require('../../../images/stop.svg');
|
2016-05-12 21:40:49 +00:00
|
|
|
var classNames = require('classnames');
|
2016-05-11 17:19:37 +00:00
|
|
|
|
|
|
|
class Toolbar extends React.Component {
|
|
|
|
render() {
|
2016-05-12 21:40:49 +00:00
|
|
|
let playButtonClass = classNames({
|
|
|
|
"toolbar__play-button": true,
|
|
|
|
"playing": this.props.isPlaying
|
|
|
|
});
|
|
|
|
|
2016-05-11 17:19:37 +00:00
|
|
|
return (
|
|
|
|
<div className="toolbar">
|
2016-05-11 19:31:17 +00:00
|
|
|
<img className="toolbar__logo" src={logoUrl}/>
|
2016-05-12 21:40:49 +00:00
|
|
|
<div className={playButtonClass} onClick={this.props.startSketch}>
|
2016-05-12 21:22:54 +00:00
|
|
|
<Isvg src={playUrl} alt="Play Sketch" />
|
2016-05-11 19:31:17 +00:00
|
|
|
</div>
|
2016-05-12 21:22:54 +00:00
|
|
|
{ this.props.isPlaying ?
|
2016-05-12 21:40:49 +00:00
|
|
|
<div className="toolbar__stop-button" onClick={this.props.stopSketch}>
|
2016-05-12 21:22:54 +00:00
|
|
|
<Isvg src={stopUrl} alt="Stop Sketch" />
|
|
|
|
</div>
|
|
|
|
: null }
|
2016-05-11 17:19:37 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Toolbar;
|