From fbed871dc5e6aff6243de3b750cdcc591fd45b55 Mon Sep 17 00:00:00 2001 From: Ismail Ali Date: Thu, 13 Feb 2025 21:09:19 +0100 Subject: [PATCH] VersionInfo ausgelagert --- components/main/uebersicht/VersionInfo.tsx | 34 ++++++++++++++++++++++ config/webVersion.ts | 2 +- pages/dashboard.tsx | 26 ++--------------- 3 files changed, 37 insertions(+), 25 deletions(-) create mode 100644 components/main/uebersicht/VersionInfo.tsx diff --git a/components/main/uebersicht/VersionInfo.tsx b/components/main/uebersicht/VersionInfo.tsx new file mode 100644 index 0000000..2220212 --- /dev/null +++ b/components/main/uebersicht/VersionInfo.tsx @@ -0,0 +1,34 @@ +"use client"; +import React from "react"; +import { Icon } from "@iconify/react"; +import { useSelector } from "react-redux"; +import { RootState } from "../../../redux/store"; + +const VersionInfo: React.FC = () => { + const appVersion = + useSelector((state: RootState) => state.variables.appVersion) || + "Unbekannt"; + const webVersion = useSelector(() => "1.0.0"); // Falls `webVersion` aus einer Config kommt + + return ( +
+

+ Versionsinformationen +

+ +
+ +

+ Applikationsversion: {appVersion} +

+
+ +
+ +

Webversion: {webVersion}

+
+
+ ); +}; + +export default VersionInfo; diff --git a/config/webVersion.ts b/config/webVersion.ts index aad6439..3703dc7 100644 --- a/config/webVersion.ts +++ b/config/webVersion.ts @@ -5,5 +5,5 @@ 2: Patch oder Hotfix (Bugfixes oder kleine Änderungen). */ -const webVersion = "1.6.21"; +const webVersion = "1.6.22"; export default webVersion; diff --git a/pages/dashboard.tsx b/pages/dashboard.tsx index 1b78dc6..95ae685 100644 --- a/pages/dashboard.tsx +++ b/pages/dashboard.tsx @@ -18,6 +18,7 @@ import { import webVersion from "../config/webVersion"; import Last20MessagesTable from "../components/main/uebersicht/Last20MessagesTable"; import NetworkInfo from "../components/main/uebersicht/NetworkInfo"; +import VersionInfo from "../components/main/uebersicht/VersionInfo"; function Dashboard() { const router = useRouter(); @@ -168,30 +169,7 @@ function Dashboard() { flex flex-col gap-2" >
-

- Versionsinformationen -

- -
- -

- Applikationsversion:{" "} - {appVersion} -

-
- -
- -

- Webversion: {webVersion} -

-
+
{renderBaugruppentraeger()}