mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
move app version to constants
This commit is contained in:
@@ -9,6 +9,7 @@ import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
appName,
|
||||
appVersion,
|
||||
legoDisclaimer,
|
||||
pybricksCopyright,
|
||||
pybricksWebsiteUrl,
|
||||
@@ -20,8 +21,6 @@ import en from './i18n.en.json';
|
||||
|
||||
import './about.scss';
|
||||
|
||||
const version = process.env.REACT_APP_VERSION;
|
||||
|
||||
type OwnProps = { isOpen: boolean; onClose: () => void };
|
||||
|
||||
type AboutDialogProps = OwnProps & WithI18nProps;
|
||||
@@ -35,7 +34,7 @@ class AboutDialog extends React.Component<AboutDialogProps> {
|
||||
const { isOpen, onClose, i18n } = this.props;
|
||||
return (
|
||||
<Dialog
|
||||
title={`${appName} v${version}`}
|
||||
title={`${appName} v${appVersion}`}
|
||||
isOpen={isOpen}
|
||||
onClose={() => onClose()}
|
||||
>
|
||||
|
||||
@@ -9,6 +9,10 @@ export const tooltipDelay = 1000;
|
||||
/** Official name of the app. */
|
||||
export const appName = process.env.REACT_APP_NAME || 'REACT_APP_NAME is undefined';
|
||||
|
||||
/** The version of the app (without the "v" prefix). */
|
||||
export const appVersion =
|
||||
process.env.REACT_APP_VERSION || 'REACT_APP_VERSION is undefined';
|
||||
|
||||
/** URL to main Pybricks website. */
|
||||
export const pybricksWebsiteUrl = 'https://pybricks.com';
|
||||
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@ import { createLogger } from 'redux-logger';
|
||||
import createSagaMiddleware from 'redux-saga';
|
||||
import './index.scss';
|
||||
import App from './app/App';
|
||||
import { appVersion } from './app/constants';
|
||||
import { i18nManager } from './i18n';
|
||||
import * as I18nToaster from './notifications/I18nToaster';
|
||||
import { rootReducer } from './reducers';
|
||||
@@ -65,7 +66,7 @@ store.subscribe(() => {
|
||||
});
|
||||
|
||||
// special styling for beta versions
|
||||
if (process.env.REACT_APP_VERSION?.match(/beta/)) {
|
||||
if (appVersion.match(/beta/)) {
|
||||
document.body.classList.add('pb-beta');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user