From 8d4ef135fc23fa23d8f3da4a1c818487c964a5b7 Mon Sep 17 00:00:00 2001 From: suubi-joshua <78343336+suubi-joshua@users.noreply.github.com> Date: Wed, 30 Oct 2024 22:49:30 +0300 Subject: [PATCH] (fix) O3-4135 - Disable help icon while user is logged out (#1186) --- .../src/help-menu/help.component.tsx | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/apps/esm-help-menu-app/src/help-menu/help.component.tsx b/packages/apps/esm-help-menu-app/src/help-menu/help.component.tsx index 1fc153f89..6628ea3e3 100644 --- a/packages/apps/esm-help-menu-app/src/help-menu/help.component.tsx +++ b/packages/apps/esm-help-menu-app/src/help-menu/help.component.tsx @@ -1,10 +1,12 @@ import React, { useState, useEffect, useRef } from 'react'; import classNames from 'classnames'; import { Help } from '@carbon/react/icons'; +import { useSession } from '@openmrs/esm-framework' import HelpMenuPopup from './help-popup.component'; import styles from './help.styles.scss'; export default function HelpMenu() { + const { user } = useSession(); const [helpMenuOpen, setHelpMenuOpen] = useState(false); const helpMenuButtonRef = useRef(null); const popupRef = useRef(null); @@ -35,15 +37,17 @@ export default function HelpMenu() { return ( <> - + {user && ( + + )} {helpMenuOpen && (