Skip to content

Commit ef0f580

Browse files
committed
version info added
1 parent e4b2822 commit ef0f580

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

client/modules/IDE/components/About.jsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
import React from 'react';
1+
import React, { useEffect, useState } from 'react';
22
import { Helmet } from 'react-helmet';
3+
import axios from 'axios';
34
import { useTranslation } from 'react-i18next';
45
import { Link } from 'react-router';
56
import SquareLogoIcon from '../../../images/p5js-square-logo.svg';
67
// import PlayIcon from '../../../images/play.svg';
78
import AsteriskIcon from '../../../images/p5-asterisk.svg';
9+
import packageData from '../../../../package.json';
810

911
function About(props) {
1012
const { t } = useTranslation();
13+
const [p5version, setP5version] = useState(0);
14+
useEffect(() => {
15+
axios
16+
.get('https://cdn.jsdelivr.net/npm/p5/package.json')
17+
.then((data) => setP5version(data?.data?.version));
18+
}, []);
1119
return (
1220
<div className="about__content">
1321
<Helmet>
@@ -20,6 +28,14 @@ function About(props) {
2028
aria-label={t('Common.p5logoARIA')}
2129
focusable="false"
2230
/>
31+
<div className="about__content-column">
32+
<p className="about__version-info">
33+
Editor version: <span>v{packageData?.version}</span>
34+
</p>
35+
<p className="about__version-info">
36+
p5.js version: <span>v{p5version}</span>
37+
</p>
38+
</div>
2339
</div>
2440
<div className="about__content-column">
2541
<h3 className="about__content-column-title">{t('About.NewP5')}</h3>

client/styles/components/_about.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,24 @@
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;

0 commit comments

Comments
 (0)