2019-06-04 12:58:13 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2019-05-24 09:59:56 +00:00
|
|
|
import React from 'react';
|
|
|
|
import InlineSVG from 'react-inlinesvg';
|
|
|
|
|
|
|
|
const logoUrl = require('../images/p5js-logo-small.svg');
|
2019-06-04 12:58:13 +00:00
|
|
|
const arrowUrl = require('../images/triangle-arrow-left.svg');
|
2019-05-24 09:59:56 +00:00
|
|
|
|
|
|
|
class NavBasic extends React.PureComponent {
|
2019-06-04 12:58:13 +00:00
|
|
|
static defaultProps = {
|
|
|
|
onBack: null
|
|
|
|
}
|
|
|
|
|
2019-05-24 09:59:56 +00:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<nav className="nav" title="main-navigation" ref={(node) => { this.node = node; }}>
|
|
|
|
<ul className="nav__items-left" title="project-menu">
|
|
|
|
<li className="nav__item-logo">
|
|
|
|
<InlineSVG src={logoUrl} alt="p5.js logo" className="svg__logo" />
|
|
|
|
</li>
|
2019-06-04 12:58:13 +00:00
|
|
|
{ this.props.onBack && (
|
|
|
|
<li className="nav__item">
|
|
|
|
<button onClick={this.props.onBack}>
|
|
|
|
<span className="nav__item-header">
|
|
|
|
<InlineSVG src={arrowUrl} alt="Left arrow" />
|
|
|
|
</span>
|
|
|
|
Back to the editor
|
|
|
|
</button>
|
|
|
|
</li>)
|
|
|
|
}
|
2019-05-24 09:59:56 +00:00
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-04 12:58:13 +00:00
|
|
|
NavBasic.propTypes = {
|
|
|
|
onBack: PropTypes.func,
|
|
|
|
};
|
2019-05-24 09:59:56 +00:00
|
|
|
|
|
|
|
export default NavBasic;
|