From c30afa45131c9bb259af3ad8cb5258ab31b5c8ce Mon Sep 17 00:00:00 2001 From: Thomas Johnson <123108455+hawkishpolicy@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:14:04 -0500 Subject: [PATCH] Edited source of Version Number (CRASM-845) (#721) * Imported version number from .env to package.json - Removed verison number from .env - Version number is now based on "version" variable in frontend/package.json - Imported frontend package.json in Footer.tsx * Destructured version from package.json * Fixed default exporting warning - Imported the entire package json file to get the version number. --- frontend/package.json | 2 +- frontend/src/components/Footer/Footer.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 3c14325a..ef0a6e27 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -155,5 +155,5 @@ "test": "react-scripts test", "typecheck": "tsc --noEmit" }, - "version": "0.1.0" + "version": "0.3.11" } diff --git a/frontend/src/components/Footer/Footer.tsx b/frontend/src/components/Footer/Footer.tsx index 22f62f60..996ea98c 100644 --- a/frontend/src/components/Footer/Footer.tsx +++ b/frontend/src/components/Footer/Footer.tsx @@ -4,12 +4,13 @@ import { useAuthContext } from 'context'; import logo from '../../assets/cyhydashboard.svg'; import * as FooterStyles from './styleFooter'; import { Stack } from '@mui/system'; +import packageJson from '../../../package.json'; export const CrossfeedFooter: React.FC = (props) => { const { logout, user } = useAuthContext(); const FooterRoot = FooterStyles.FooterRoot; const footerClasses = FooterStyles.footerClasses; - const versionNumber = process.env.REACT_APP_VERSION_NUMBER; + const versionNumber = packageJson.version; return (