Skip to content

added web editor and p5 version info to the about section #2118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions client/modules/IDE/components/About.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import React from 'react';
import { useSelector } from 'react-redux';
import { Helmet } from 'react-helmet';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router';
import SquareLogoIcon from '../../../images/p5js-square-logo.svg';
// import PlayIcon from '../../../images/play.svg';
import AsteriskIcon from '../../../images/p5-asterisk.svg';
import packageData from '../../../../package.json';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!


function About(props) {
const { t } = useTranslation();
const p5version = useSelector((state) => {
const index = state.files.find((file) => file.name === 'index.html');
return index?.content.match(/\/p5\.js\/([\d.]+)\//)?.[1];
});
return (
<div className="about__content">
<Helmet>
Expand All @@ -20,6 +26,14 @@ function About(props) {
aria-label={t('Common.p5logoARIA')}
focusable="false"
/>
<div className="about__content-column">
<p className="about__version-info">
Web Editor: <span>v{packageData?.version}</span>
</p>
<p className="about__version-info">
p5.js: <span>v{p5version}</span>
</p>
</div>
</div>
<div className="about__content-column">
<h3 className="about__content-column-title">{t('About.NewP5')}</h3>
Expand Down
18 changes: 18 additions & 0 deletions client/styles/components/_about.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@
}
}

.about__version-info {
@include themify() {
padding-top: #{8 / $base-font-size}rem;
font-size: #{16 / $base-font-size}rem;
span {
color: getThemifyVariable('logo-color');
}
&:first-child {
padding-top: #{30 /$base-font-size}rem;
}
}
// span {
// @include themify() {
// fill: getThemifyVariable('logo-color');
// }
// }
}

.about__footer {
display: flex;
justify-content: space-between;
Expand Down