File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
+ import { useSelector } from 'react-redux' ;
2
3
import { Helmet } from 'react-helmet' ;
3
4
import { useTranslation } from 'react-i18next' ;
4
5
import { Link } from 'react-router' ;
5
6
import SquareLogoIcon from '../../../images/p5js-square-logo.svg' ;
6
7
// import PlayIcon from '../../../images/play.svg';
7
8
import AsteriskIcon from '../../../images/p5-asterisk.svg' ;
9
+ import packageData from '../../../../package.json' ;
8
10
9
11
function About ( props ) {
10
12
const { t } = useTranslation ( ) ;
13
+ const p5version = useSelector ( ( state ) => {
14
+ const index = state . files . find ( ( file ) => file . name === 'index.html' ) ;
15
+ return index ?. content . match ( / \/ p 5 \. j s \/ ( [ \d . ] + ) \/ / ) ?. [ 1 ] ;
16
+ } ) ;
11
17
return (
12
18
< div className = "about__content" >
13
19
< Helmet >
@@ -20,6 +26,14 @@ function About(props) {
20
26
aria-label = { t ( 'Common.p5logoARIA' ) }
21
27
focusable = "false"
22
28
/>
29
+ < div className = "about__content-column" >
30
+ < p className = "about__version-info" >
31
+ Web Editor: < span > v{ packageData ?. version } </ span >
32
+ </ p >
33
+ < p className = "about__version-info" >
34
+ p5.js: < span > v{ p5version } </ span >
35
+ </ p >
36
+ </ div >
23
37
</ div >
24
38
< div className = "about__content-column" >
25
39
< h3 className = "about__content-column-title" > { t ( 'About.NewP5' ) } </ h3 >
Original file line number Diff line number Diff line change 74
74
}
75
75
}
76
76
77
+ .about__version-info {
78
+ @include themify () {
79
+ padding-top : #{8 / $base-font-size } rem;
80
+ font-size : #{16 / $base-font-size } rem;
81
+ span {
82
+ color : getThemifyVariable (' logo-color' );
83
+ }
84
+ & :first-child {
85
+ padding-top : #{30 / $base-font-size } rem;
86
+ }
87
+ }
88
+ // span {
89
+ // @include themify() {
90
+ // fill: getThemifyVariable('logo-color');
91
+ // }
92
+ // }
93
+ }
94
+
77
95
.about__footer {
78
96
display : flex ;
79
97
justify-content : space-between ;
You can’t perform that action at this time.
0 commit comments