From a526b26039ee161ad26b2e2e88a5c87780f4c18f Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Thu, 9 Mar 2023 08:31:20 +0100 Subject: [PATCH] implemented show/hide resources menu item depending on its value in env --- .env | 4 ++- .env.development | 2 ++ .env.production | 2 ++ src/components/Partials/MobileSideBar.jsx | 5 +++ src/components/Partials/Sidebar.jsx | 41 +++++++++++++---------- 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/.env b/.env index 8a2ac07..aa36b51 100755 --- a/.env +++ b/.env @@ -17,4 +17,6 @@ REACT_APP_TRACKING="Tracking" REACT_APP_RESOURCES="Resources" REACT_APP_HISTORY="History" -REACT_APP_TRACKING_SHOW=1 \ No newline at end of file +REACT_APP_TRACKING_SHOW=1 + +REACT_APP_RESOURCES_SHOW=1 \ No newline at end of file diff --git a/.env.development b/.env.development index 6e7f41d..4b655af 100644 --- a/.env.development +++ b/.env.development @@ -18,3 +18,5 @@ REACT_APP_RESOURCES="Resources" REACT_APP_HISTORY="History" REACT_APP_TRACKING_SHOW=1 + +REACT_APP_RESOURCES_SHOW=1 diff --git a/.env.production b/.env.production index f87d2cf..5232978 100644 --- a/.env.production +++ b/.env.production @@ -18,3 +18,5 @@ REACT_APP_RESOURCES="Resources" REACT_APP_HISTORY="History" REACT_APP_TRACKING_SHOW=0 + +REACT_APP_RESOURCES_SHOW=0 diff --git a/src/components/Partials/MobileSideBar.jsx b/src/components/Partials/MobileSideBar.jsx index 57c2cb2..e1c8d5a 100755 --- a/src/components/Partials/MobileSideBar.jsx +++ b/src/components/Partials/MobileSideBar.jsx @@ -128,6 +128,8 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) { + + {process.env.REACT_APP_RESOURCES_SHOW == true ?
  • + : + <> + }
  • -
  • - (navData.isActive ? "active" : ""), - sidebar ? "justify-start space-x-3.5" : "justify-center") - }`} - > - - - - + (navData.isActive ? "active" : ""), + sidebar ? "justify-start space-x-3.5" : "justify-center") }`} > - {process.env.REACT_APP_RESOURCES} - - -
  • + + + + + {process.env.REACT_APP_RESOURCES} + + + + : + <> + }