Browse Source

style: display patient management related menu to the right of patient management button in navigation area

sw 1 month ago
parent
commit
e31da7d8e0
1 changed files with 12 additions and 7 deletions
  1. 12 7
      src/layouts/BusinessZone.tsx

+ 12 - 7
src/layouts/BusinessZone.tsx

@@ -1,5 +1,5 @@
 import React, { useState, useEffect, useRef } from 'react';
-import { Space, Dropdown, Menu } from 'antd';
+import { Space, Menu, Popover } from 'antd';
 import { FormattedMessage } from 'react-intl';
 import { useSelector } from 'react-redux';
 import {
@@ -167,7 +167,10 @@ const BusinessZone: React.FC<BusinessZoneProps> = ({ onMenuClick }) => {
           <MeButton
             key={child.key}
             data-testid={child.key}
-            onClick={() => onMenuClick?.(child.key)}
+            onClick={() => {
+              setFloatingMenuVisible(false);
+              onMenuClick?.(child.key);
+            }}
             username={child.label}
           />
         ))}
@@ -200,10 +203,12 @@ const BusinessZone: React.FC<BusinessZoneProps> = ({ onMenuClick }) => {
                 }
               >
                 {item.key === 'patient_management' ? (
-                  <Dropdown
-                    overlay={menu}
-                    trigger={['click']}
-                    placement="topRight"
+                  <Popover
+                    open={floatingMenuVisible}
+                    placement="rightTop"
+                    content={menu}
+                    trigger="click"
+                    arrow={false}
                   >
                     <MeButton
                       icon={item.icon}
@@ -211,7 +216,7 @@ const BusinessZone: React.FC<BusinessZoneProps> = ({ onMenuClick }) => {
                       onClick={handlePatientManagementClick}
                       username={item.label}
                     />
-                  </Dropdown>
+                  </Popover>
                 ) : (
                   <MeButton
                     icon={item.icon}