2016-11-10 22:13:00 +01:00
|
|
|
import React, { PropTypes } from 'react';
|
2016-08-22 18:35:59 +02:00
|
|
|
import InlineSVG from 'react-inlinesvg';
|
|
|
|
const exitUrl = require('../../../images/exit.svg');
|
|
|
|
import { browserHistory } from 'react-router';
|
|
|
|
|
|
|
|
class About extends React.Component {
|
2016-11-10 22:13:00 +01:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.closeAboutModal = this.closeAboutModal.bind(this);
|
|
|
|
}
|
|
|
|
|
2016-09-28 18:09:42 +02:00
|
|
|
componentDidMount() {
|
|
|
|
this.refs.about.focus();
|
|
|
|
}
|
|
|
|
|
2016-08-22 18:35:59 +02:00
|
|
|
closeAboutModal() {
|
2016-11-10 22:13:00 +01:00
|
|
|
browserHistory.push(this.props.previousPath);
|
2016-08-22 18:35:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2016-09-28 18:09:42 +02:00
|
|
|
<section className="about" ref="about" tabIndex="0">
|
2016-08-22 18:35:59 +02:00
|
|
|
<header className="about__header">
|
|
|
|
<h2>About</h2>
|
|
|
|
<button className="about__exit-button" onClick={this.closeAboutModal}>
|
|
|
|
<InlineSVG src={exitUrl} alt="Close About Overlay" />
|
|
|
|
</button>
|
|
|
|
</header>
|
|
|
|
<div className="about__copy">
|
|
|
|
<p>
|
|
|
|
The p5.js Web Editor is an open source project.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<a
|
|
|
|
href="https://github.com/processing/p5.js-web-editor"
|
|
|
|
target="_blank"
|
|
|
|
>Contribute </a>
|
|
|
|
or
|
|
|
|
<a
|
|
|
|
href="https://github.com/processing/p5.js-web-editor/issues/new"
|
|
|
|
target="_blank"
|
|
|
|
> report a bug.</a>
|
|
|
|
</p>
|
|
|
|
</div>
|
2016-09-28 18:09:42 +02:00
|
|
|
</section>
|
2016-08-22 18:35:59 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-10 22:13:00 +01:00
|
|
|
About.propTypes = {
|
|
|
|
previousPath: PropTypes.string.isRequired
|
|
|
|
};
|
|
|
|
|
2016-08-22 18:35:59 +02:00
|
|
|
export default About;
|