From 81326d867339f151e40a2d7bb14a3e7e92fcb177 Mon Sep 17 00:00:00 2001 From: MVarshini Date: Fri, 2 Jun 2023 19:09:59 +0530 Subject: [PATCH 1/2] PBENCH-1092 Specify version number Include the version number in the footer --- .../components/FooterComponent/index.jsx | 19 +++++++++++++++++++ .../components/FooterComponent/index.less | 13 +++++++++++++ .../modules/containers/MainLayout/index.jsx | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 dashboard/src/modules/components/FooterComponent/index.jsx create mode 100644 dashboard/src/modules/components/FooterComponent/index.less diff --git a/dashboard/src/modules/components/FooterComponent/index.jsx b/dashboard/src/modules/components/FooterComponent/index.jsx new file mode 100644 index 0000000000..47aff7f7b8 --- /dev/null +++ b/dashboard/src/modules/components/FooterComponent/index.jsx @@ -0,0 +1,19 @@ +import "./index.less"; + +import React from "react"; +import { useSelector } from "react-redux"; + +const Footer = () => { + const { endpoints } = useSelector((state) => state.apiEndpoint); + const versionNumber = endpoints?.identification + ?.split(" ") + .slice(-1) + .join(""); + return ( +
+ Version @ {versionNumber} +
+ ); +}; + +export default Footer; diff --git a/dashboard/src/modules/components/FooterComponent/index.less b/dashboard/src/modules/components/FooterComponent/index.less new file mode 100644 index 0000000000..e8c320bd3e --- /dev/null +++ b/dashboard/src/modules/components/FooterComponent/index.less @@ -0,0 +1,13 @@ +.footer-container { + width: 100%; + padding: 1.5rem; + background: #151515; + color: #ffffff; + font-size: .85em; + overflow-x: hidden; + text-align: center; + + span { + font-style: italic; + } +} \ No newline at end of file diff --git a/dashboard/src/modules/containers/MainLayout/index.jsx b/dashboard/src/modules/containers/MainLayout/index.jsx index 98855e98be..0902df5439 100644 --- a/dashboard/src/modules/containers/MainLayout/index.jsx +++ b/dashboard/src/modules/containers/MainLayout/index.jsx @@ -3,6 +3,7 @@ import "./index.less"; import { Outlet, useNavigate } from "react-router-dom"; import { Page, PageSection, PageSectionVariants } from "@patternfly/react-core"; +import Footer from "modules/components/FooterComponent"; import HeaderComponent from "modules/components/HeaderComponent"; import LoadingComponent from "modules/components/LoadingComponent"; import React from "react"; @@ -24,6 +25,7 @@ const MainLayout = () => { +