2019-06-04 14:58:13 +02:00
|
|
|
import PropTypes from 'prop-types';
|
2019-05-24 11:59:56 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
2020-04-30 00:34:37 +02:00
|
|
|
import LogoIcon from '../images/p5js-logo-small.svg';
|
|
|
|
import ArrowIcon from '../images/triangle-arrow-left.svg';
|
2019-05-24 11:59:56 +02:00
|
|
|
|
|
|
|
class NavBasic extends React.PureComponent {
|
2019-06-04 14:58:13 +02:00
|
|
|
static defaultProps = {
|
|
|
|
onBack: null
|
|
|
|
}
|
|
|
|
|
2019-05-24 11:59:56 +02:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<nav className="nav" title="main-navigation" ref={(node) => { this.node = node; }}>
|
2020-04-09 06:23:42 +02:00
|
|
|
<ul className="nav__items-left">
|
2019-05-24 11:59:56 +02:00
|
|
|
<li className="nav__item-logo">
|
2020-05-06 01:03:58 +02:00
|
|
|
<LogoIcon role="img" aria-label="p5.js Logo" focusable="false" className="svg__logo" />
|
2019-05-24 11:59:56 +02:00
|
|
|
</li>
|
2019-06-04 14:58:13 +02:00
|
|
|
{ this.props.onBack && (
|
|
|
|
<li className="nav__item">
|
|
|
|
<button onClick={this.props.onBack}>
|
|
|
|
<span className="nav__item-header">
|
2020-05-06 01:03:58 +02:00
|
|
|
<ArrowIcon focusable="false" aria-hidden="true" />
|
2019-06-04 14:58:13 +02:00
|
|
|
</span>
|
|
|
|
Back to the editor
|
|
|
|
</button>
|
|
|
|
</li>)
|
|
|
|
}
|
2019-05-24 11:59:56 +02:00
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-04 14:58:13 +02:00
|
|
|
NavBasic.propTypes = {
|
|
|
|
onBack: PropTypes.func,
|
|
|
|
};
|
2019-05-24 11:59:56 +02:00
|
|
|
|
|
|
|
export default NavBasic;
|