|
1 |
| -import React, { PropTypes } from 'react'; |
| 1 | +import React from 'react'; |
2 | 2 | import InlineSVG from 'react-inlinesvg';
|
3 |
| -import { browserHistory } from 'react-router'; |
4 | 3 |
|
5 |
| -const exitUrl = require('../../../images/exit.svg'); |
6 | 4 | const squareLogoUrl = require('../../../images/p5js-square-logo.svg');
|
7 | 5 | const playUrl = require('../../../images/play.svg');
|
8 | 6 | const asteriskUrl = require('../../../images/p5-asterisk.svg');
|
9 | 7 |
|
10 |
| -class About extends React.Component { |
11 |
| - constructor(props) { |
12 |
| - super(props); |
13 |
| - this.closeAboutModal = this.closeAboutModal.bind(this); |
14 |
| - } |
15 |
| - |
16 |
| - componentDidMount() { |
17 |
| - this.aboutSection.focus(); |
18 |
| - } |
19 |
| - |
20 |
| - closeAboutModal() { |
21 |
| - browserHistory.push(this.props.previousPath); |
22 |
| - } |
23 |
| - |
24 |
| - render() { |
25 |
| - return ( |
26 |
| - <section className="about" ref={(element) => { this.aboutSection = element; }} tabIndex="0"> |
27 |
| - <header className="about__header"> |
28 |
| - <h2 className="about__header-title">Welcome</h2> |
29 |
| - <button className="about__exit-button" onClick={this.closeAboutModal}> |
30 |
| - <InlineSVG src={exitUrl} alt="Close About Overlay" /> |
31 |
| - </button> |
32 |
| - </header> |
33 |
| - <div className="about__content"> |
34 |
| - <div className="about__content-column"> |
35 |
| - <InlineSVG className="about__logo" src={squareLogoUrl} alt="p5js Square Logo" /> |
36 |
| - <p className="about__play-video"> |
37 |
| - <a |
38 |
| - href="http://hello.p5js.org/" |
39 |
| - target="_blank" |
40 |
| - rel="noopener noreferrer" |
41 |
| - > |
42 |
| - <InlineSVG className="about__play-video-button" src={playUrl} alt="Play Hello Video" /> |
43 |
| - Play hello! video</a> |
44 |
| - </p> |
45 |
| - </div> |
46 |
| - <div className="about__content-column"> |
47 |
| - <h3 className="about__content-column-title">New to p5.js?</h3> |
48 |
| - <p className="about__content-column-list"> |
49 |
| - <a |
50 |
| - href="https://p5js.org/examples/" |
51 |
| - target="_blank" |
52 |
| - rel="noopener noreferrer" |
53 |
| - > |
54 |
| - <InlineSVG className="about__content-column-asterisk" src={asteriskUrl} alt="p5 asterisk" /> |
55 |
| - Examples</a> |
56 |
| - </p> |
57 |
| - <p className="about__content-column-list"> |
58 |
| - <a |
59 |
| - href="https://p5js.org/tutorials/" |
60 |
| - target="_blank" |
61 |
| - rel="noopener noreferrer" |
62 |
| - > |
63 |
| - <InlineSVG className="about__content-column-asterisk" src={asteriskUrl} alt="p5 asterisk" /> |
64 |
| - Tutorials</a> |
65 |
| - </p> |
66 |
| - </div> |
67 |
| - <div className="about__content-column"> |
68 |
| - <h3 className="about__content-column-title">Resources</h3> |
69 |
| - <p className="about__content-column-list"> |
70 |
| - <a |
71 |
| - href="https://p5js.org/libraries/" |
72 |
| - target="_blank" |
73 |
| - rel="noopener noreferrer" |
74 |
| - > |
75 |
| - <InlineSVG className="about__content-column-asterisk" src={asteriskUrl} alt="p5 asterisk" /> |
76 |
| - Libraries</a> |
77 |
| - </p> |
78 |
| - <p className="about__content-column-list"> |
79 |
| - <a |
80 |
| - href="https://p5js.org/reference/" |
81 |
| - target="_blank" |
82 |
| - rel="noopener noreferrer" |
83 |
| - > |
84 |
| - <InlineSVG className="about__content-column-asterisk" src={asteriskUrl} alt="p5 asterisk" /> |
85 |
| - Reference</a> |
86 |
| - </p> |
87 |
| - <p className="about__content-column-list"> |
88 |
| - <a |
89 |
| - href="https://forum.processing.org/two/" |
90 |
| - target="_blank" |
91 |
| - rel="noopener noreferrer" |
92 |
| - > |
93 |
| - <InlineSVG className="about__content-column-asterisk" src={asteriskUrl} alt="p5 asterisk" /> |
94 |
| - Forum</a> |
95 |
| - </p> |
96 |
| - </div> |
97 |
| - </div> |
98 |
| - <div className="about__footer"> |
99 |
| - <p className="about__footer-list"> |
100 |
| - <a |
101 |
| - href="https://github.com/processing/p5.js-web-editor" |
102 |
| - target="_blank" |
103 |
| - rel="noopener noreferrer" |
104 |
| - >Contribute</a> |
105 |
| - </p> |
106 |
| - <p className="about__footer-list"> |
107 |
| - <a |
108 |
| - href="https://github.com/processing/p5.js-web-editor/issues/new" |
109 |
| - target="_blank" |
110 |
| - rel="noopener noreferrer" |
111 |
| - >Report a bug</a> |
112 |
| - </p> |
113 |
| - <p className="about__footer-list"> |
114 |
| - <a |
115 |
| - href="https://twitter.com/p5xjs?lang=en" |
116 |
| - target="_blank" |
117 |
| - rel="noopener noreferrer" |
118 |
| - >Twitter</a> |
119 |
| - </p> |
120 |
| - <button className="about__ok-button" onClick={this.closeAboutModal}>OK!</button> |
121 |
| - </div> |
122 |
| - </section> |
123 |
| - ); |
124 |
| - } |
| 8 | +function About(props) { |
| 9 | + return ( |
| 10 | + <div className="about__content"> |
| 11 | + <div className="about__content-column"> |
| 12 | + <InlineSVG className="about__logo" src={squareLogoUrl} alt="p5js Square Logo" /> |
| 13 | + <p className="about__play-video"> |
| 14 | + <a |
| 15 | + href="http://hello.p5js.org/" |
| 16 | + target="_blank" |
| 17 | + rel="noopener noreferrer" |
| 18 | + > |
| 19 | + <InlineSVG className="about__play-video-button" src={playUrl} alt="Play Hello Video" /> |
| 20 | + Play hello! video</a> |
| 21 | + </p> |
| 22 | + </div> |
| 23 | + <div className="about__content-column"> |
| 24 | + <h3 className="about__content-column-title">New to p5.js?</h3> |
| 25 | + <p className="about__content-column-list"> |
| 26 | + <a |
| 27 | + href="https://p5js.org/examples/" |
| 28 | + target="_blank" |
| 29 | + rel="noopener noreferrer" |
| 30 | + > |
| 31 | + <InlineSVG className="about__content-column-asterisk" src={asteriskUrl} alt="p5 asterisk" /> |
| 32 | + Examples</a> |
| 33 | + </p> |
| 34 | + <p className="about__content-column-list"> |
| 35 | + <a |
| 36 | + href="https://p5js.org/tutorials/" |
| 37 | + target="_blank" |
| 38 | + rel="noopener noreferrer" |
| 39 | + > |
| 40 | + <InlineSVG className="about__content-column-asterisk" src={asteriskUrl} alt="p5 asterisk" /> |
| 41 | + Tutorials</a> |
| 42 | + </p> |
| 43 | + </div> |
| 44 | + <div className="about__content-column"> |
| 45 | + <h3 className="about__content-column-title">Resources</h3> |
| 46 | + <p className="about__content-column-list"> |
| 47 | + <a |
| 48 | + href="https://p5js.org/libraries/" |
| 49 | + target="_blank" |
| 50 | + rel="noopener noreferrer" |
| 51 | + > |
| 52 | + <InlineSVG className="about__content-column-asterisk" src={asteriskUrl} alt="p5 asterisk" /> |
| 53 | + Libraries</a> |
| 54 | + </p> |
| 55 | + <p className="about__content-column-list"> |
| 56 | + <a |
| 57 | + href="https://p5js.org/reference/" |
| 58 | + target="_blank" |
| 59 | + rel="noopener noreferrer" |
| 60 | + > |
| 61 | + <InlineSVG className="about__content-column-asterisk" src={asteriskUrl} alt="p5 asterisk" /> |
| 62 | + Reference</a> |
| 63 | + </p> |
| 64 | + <p className="about__content-column-list"> |
| 65 | + <a |
| 66 | + href="https://forum.processing.org/two/" |
| 67 | + target="_blank" |
| 68 | + rel="noopener noreferrer" |
| 69 | + > |
| 70 | + <InlineSVG className="about__content-column-asterisk" src={asteriskUrl} alt="p5 asterisk" /> |
| 71 | + Forum</a> |
| 72 | + </p> |
| 73 | + </div> |
| 74 | + <div className="about__footer"> |
| 75 | + <p className="about__footer-list"> |
| 76 | + <a |
| 77 | + href="https://github.com/processing/p5.js-web-editor" |
| 78 | + target="_blank" |
| 79 | + rel="noopener noreferrer" |
| 80 | + >Contribute</a> |
| 81 | + </p> |
| 82 | + <p className="about__footer-list"> |
| 83 | + <a |
| 84 | + href="https://github.com/processing/p5.js-web-editor/issues/new" |
| 85 | + target="_blank" |
| 86 | + rel="noopener noreferrer" |
| 87 | + >Report a bug</a> |
| 88 | + </p> |
| 89 | + <p className="about__footer-list"> |
| 90 | + <a |
| 91 | + href="https://twitter.com/p5xjs?lang=en" |
| 92 | + target="_blank" |
| 93 | + rel="noopener noreferrer" |
| 94 | + >Twitter</a> |
| 95 | + </p> |
| 96 | + </div> |
| 97 | + </div> |
| 98 | + ); |
125 | 99 | }
|
126 | 100 |
|
127 |
| -About.propTypes = { |
128 |
| - previousPath: PropTypes.string.isRequired |
129 |
| -}; |
130 |
| - |
131 | 101 | export default About;
|
0 commit comments