From 000b988df7d4fb15c691ca62bc6d5a92cd94d161 Mon Sep 17 00:00:00 2001 From: Situ Chandra Shil <108292595+situchan@users.noreply.github.com> Date: Thu, 27 Nov 2025 08:58:58 +1100 Subject: [PATCH] Revert "Two updates to workspace Overview page" --- src/components/Section/index.tsx | 2 +- src/pages/workspace/WorkspaceOverviewPage.tsx | 82 ++++++++++--------- 2 files changed, 45 insertions(+), 39 deletions(-) diff --git a/src/components/Section/index.tsx b/src/components/Section/index.tsx index 74606d025faaa..de80d4deb02d5 100644 --- a/src/components/Section/index.tsx +++ b/src/components/Section/index.tsx @@ -186,7 +186,7 @@ function Section({ /> )} - {renderTitle ? renderTitle() : !!title && {title}} + {renderTitle ? renderTitle() : {title}} {cardLayout === CARD_LAYOUT.ICON_ON_RIGHT && ( = shouldUseNarrowLayout ? [styles.mhv12, styles.mhn5, styles.mbn5] : [styles.mhv8, styles.mhn8, styles.mbn5]; const shouldShowAddress = !readOnly || !!formattedAddress; const {isAccountLocked, showLockedAccountModal} = useContext(LockedAccountContext); const [lastPaymentMethod] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD, {canBeMissing: true}); @@ -377,27 +380,20 @@ function WorkspaceOverviewPage({policyDraft, policy: policyProp, route}: Workspa }; const renderDropdownMenu = (options: Array>) => ( - {}} - shouldAlwaysShowDropdownMenu - customText={translate('common.more')} - options={options} - isSplitButton={false} - wrapperStyle={isPolicyAdmin ? styles.flexGrow0 : styles.flexGrow1} - /> + + {}} + shouldAlwaysShowDropdownMenu + customText={translate('common.more')} + options={options} + isSplitButton={false} + wrapperStyle={styles.flexGrow1} + /> + ); - const handleInvitePress = useCallback(() => { - if (isAccountLocked) { - showLockedAccountModal(); - return; - } - clearInviteDraft(route.params.policyID); - Navigation.navigate(ROUTES.WORKSPACE_INVITE.getRoute(route.params.policyID, Navigation.getActiveRouteWithoutParams())); - }, [isAccountLocked, showLockedAccountModal, route.params.policyID]); - const getHeaderButtons = () => { const secondaryActions: Array> = []; const canLeave = !isOwner; @@ -415,6 +411,21 @@ function WorkspaceOverviewPage({policyDraft, policy: policyProp, route}: Workspa return null; } + if (isPolicyAdmin) { + secondaryActions.push({ + value: 'invite', + text: translate('common.invite'), + icon: expensifyIcons.UserPlus, + onSelected: () => { + if (isAccountLocked) { + showLockedAccountModal(); + return; + } + clearInviteDraft(route.params.policyID); + Navigation.navigate(ROUTES.WORKSPACE_INVITE.getRoute(route.params.policyID, Navigation.getActiveRouteWithoutParams())); + }, + }); + } secondaryActions.push({ value: 'share', text: translate('common.share'), @@ -451,22 +462,7 @@ function WorkspaceOverviewPage({policyDraft, policy: policyProp, route}: Workspa }); } - return ( - - {isPolicyAdmin && ( -