Skip to content

Commit

Permalink
Merge pull request #49664 from Expensify/rodrigo-fix-threedot-menu-me…
Browse files Browse the repository at this point in the history
…mbers

Prevents three dot menu from showing up in members page if not policy admin
  • Loading branch information
srikarparsi authored Sep 24, 2024
2 parents cb6a3dc + a752d0c commit e232163
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/workspace/WorkspaceMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,10 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
};

const threeDotsMenuItems = useMemo(() => {
if (!isPolicyAdmin) {
return [];
}

const menuItems = [
{
icon: Expensicons.Table,
Expand Down Expand Up @@ -596,7 +600,7 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
];

return menuItems;
}, [policyID, translate, isOffline]);
}, [policyID, translate, isOffline, isPolicyAdmin]);

const selectionModeHeader = selectionMode?.isEnabled && shouldUseNarrowLayout;

Expand All @@ -610,7 +614,7 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
testID={WorkspaceMembersPage.displayName}
shouldShowLoading={false}
shouldShowOfflineIndicatorInWideScreen
shouldShowThreeDotsButton
shouldShowThreeDotsButton={isPolicyAdmin}
threeDotsMenuItems={threeDotsMenuItems}
threeDotsAnchorPosition={styles.threeDotsPopoverOffsetNoCloseButton(windowWidth)}
shouldShowNonAdmin
Expand Down

0 comments on commit e232163

Please sign in to comment.