File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2+ import { useSelector } from 'react-redux' ;
23import { Helmet } from 'react-helmet' ;
34import { useTranslation } from 'react-i18next' ;
45import { Link } from 'react-router' ;
56import SquareLogoIcon from '../../../images/p5js-square-logo.svg' ;
67// import PlayIcon from '../../../images/play.svg';
78import AsteriskIcon from '../../../images/p5-asterisk.svg' ;
9+ import packageData from '../../../../package.json' ;
810
911function About ( props ) {
1012 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+ } ) ;
1117 return (
1218 < div className = "about__content" >
1319 < Helmet >
@@ -20,6 +26,14 @@ function About(props) {
2026 aria-label = { t ( 'Common.p5logoARIA' ) }
2127 focusable = "false"
2228 />
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 >
2337 </ div >
2438 < div className = "about__content-column" >
2539 < h3 className = "about__content-column-title" > { t ( 'About.NewP5' ) } </ h3 >
Original file line number Diff line number Diff line change 7474 }
7575}
7676
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+
7795.about__footer {
7896 display : flex ;
7997 justify-content : space-between ;
You can’t perform that action at this time.
0 commit comments