From 9811f2e219782e7a6703f2036ffcb536741ba994 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 6 Mar 2025 16:02:26 +0800 Subject: [PATCH 1/6] fix wrong popover position --- src/components/ThreeDotsMenu/index.tsx | 15 ++++--- src/components/ThreeDotsMenu/types.ts | 24 ++++++++---- .../Search/SavedSearchItemThreeDotMenu.tsx | 36 ++++++++++------- .../CardSection/CardSectionActions/index.tsx | 38 +++++++++--------- .../Subscription/TaxExemptActions/index.tsx | 34 ++++++++-------- src/pages/workspace/WorkspacesListRow.tsx | 39 +++++++++---------- .../accounting/PolicyAccountingPage.tsx | 35 +++++++++-------- 7 files changed, 120 insertions(+), 101 deletions(-) diff --git a/src/components/ThreeDotsMenu/index.tsx b/src/components/ThreeDotsMenu/index.tsx index 79528b02c56d..23bf0492ef1a 100644 --- a/src/components/ThreeDotsMenu/index.tsx +++ b/src/components/ThreeDotsMenu/index.tsx @@ -12,6 +12,7 @@ import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import {isMobile} from '@libs/Browser'; +import {AnchorPosition} from '@styles/index'; import variables from '@styles/variables'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -29,6 +30,7 @@ function ThreeDotsMenu({ horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, // we assume that popover menu opens below the button, anchor is at TOP }, + getAnchorPosition, shouldOverlay = false, shouldSetModalVisibility = true, disabled = false, @@ -42,6 +44,7 @@ function ThreeDotsMenu({ const theme = useTheme(); const styles = useThemeStyles(); const [isPopupMenuVisible, setPopupMenuVisible] = useState(false); + const [position, setPosition] = useState(); const buttonRef = useRef(null); const {translate} = useLocalize(); const isBehindModal = modal?.willAlertModalBecomeVisible && !modal?.isPopover && !shouldOverlay; @@ -61,17 +64,19 @@ function ThreeDotsMenu({ hidePopoverMenu(); }, [isBehindModal, isPopupMenuVisible]); - const onThreeDotsPress = () => { + const onThreeDotsPress = async () => { if (isPopupMenuVisible) { hidePopoverMenu(); return; } hideProductTrainingTooltip?.(); buttonRef.current?.blur(); - showPopoverMenu(); - if (onIconPress) { - onIconPress(); + + if (getAnchorPosition) { + setPosition(await getAnchorPosition()); } + showPopoverMenu(); + onIconPress?.(); }; const TooltipToRender = shouldShowProductTrainingTooltip ? EducationalTooltip : Tooltip; @@ -121,7 +126,7 @@ function ThreeDotsMenu({ ; +type ThreeDotsMenuWithOptionalAnchorProps = + | (ThreeDotsMenuProps & { + /** The anchor position of the menu */ + anchorPosition: AnchorPosition; + + /** A callback to get the anchor position dynamically */ + getAnchorPosition?: () => Promise; + }) + | (ThreeDotsMenuProps & { + /** The anchor position of the menu */ + anchorPosition?: AnchorPosition; + + /** A callback to get the anchor position dynamically */ + getAnchorPosition: () => Promise; + }); -export type {LayoutChangeEventWithTarget}; -export default ThreeDotsMenuProps; +export default ThreeDotsMenuWithOptionalAnchorProps; diff --git a/src/pages/Search/SavedSearchItemThreeDotMenu.tsx b/src/pages/Search/SavedSearchItemThreeDotMenu.tsx index 2a0733e40c7e..8a76facfe2f5 100644 --- a/src/pages/Search/SavedSearchItemThreeDotMenu.tsx +++ b/src/pages/Search/SavedSearchItemThreeDotMenu.tsx @@ -1,9 +1,10 @@ -import React, {useRef, useState} from 'react'; -import type {LayoutChangeEvent, LayoutRectangle, NativeSyntheticEvent} from 'react-native'; +import React, {useCallback, useRef} from 'react'; import {View} from 'react-native'; import type {PopoverMenuItem} from '@components/PopoverMenu'; import ThreeDotsMenu from '@components/ThreeDotsMenu'; +import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useThemeStyles from '@hooks/useThemeStyles'; +import type {AnchorPosition} from '@styles/index'; import CONST from '@src/CONST'; type SavedSearchItemThreeDotMenuProps = { @@ -14,29 +15,34 @@ type SavedSearchItemThreeDotMenuProps = { shouldRenderTooltip: boolean; }; -type LayoutChangeEventWithTarget = NativeSyntheticEvent<{layout: LayoutRectangle; target: HTMLElement}>; - function SavedSearchItemThreeDotMenu({menuItems, isDisabledItem, hideProductTrainingTooltip, renderTooltipContent, shouldRenderTooltip}: SavedSearchItemThreeDotMenuProps) { const threeDotsMenuContainerRef = useRef(null); - const [threeDotsMenuPosition, setThreeDotsMenuPosition] = useState({horizontal: 0, vertical: 0}); + const {shouldUseNarrowLayout} = useResponsiveLayout(); const styles = useThemeStyles(); + + const calculateAndSetThreeDotsMenuPosition = useCallback(async () => { + if (shouldUseNarrowLayout) { + return {horizontal: 0, vertical: 0}; + } + const position = await new Promise((resolve) => { + threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { + resolve({ + horizontal: x + width, + vertical: y, + }); + }); + }); + return position; + }, [shouldUseNarrowLayout]); + return ( { - const target = e.target || (e as LayoutChangeEventWithTarget).nativeEvent.target; - target?.measureInWindow((x, y, width) => { - setThreeDotsMenuPosition({ - horizontal: x + width, - vertical: y, - }); - }); - }} > ({horizontal: 0, vertical: 0}); const threeDotsMenuContainerRef = useRef(null); const overflowMenu: ThreeDotsMenuProps['menuItems'] = useMemo( @@ -39,25 +36,26 @@ function CardSectionActions() { [translate], ); - return ( - { - if (shouldUseNarrowLayout) { - return; - } - const target = e.target || (e as LayoutChangeEventWithTarget).nativeEvent.target; - target?.measureInWindow((x, y, width) => { - setThreeDotsMenuPosition({ - horizontal: x + width, - vertical: y, - }); + const calculateAndSetThreeDotsMenuPosition = useCallback(async () => { + if (shouldUseNarrowLayout) { + return {horizontal: 0, vertical: 0}; + } + const position = await new Promise((resolve) => { + threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { + resolve({ + horizontal: x + width, + vertical: y + height, }); - }} - > + }); + }); + return position; + }, [shouldUseNarrowLayout]); + + return ( + diff --git a/src/pages/settings/Subscription/TaxExemptActions/index.tsx b/src/pages/settings/Subscription/TaxExemptActions/index.tsx index 54efe0562e92..f5de78b38529 100644 --- a/src/pages/settings/Subscription/TaxExemptActions/index.tsx +++ b/src/pages/settings/Subscription/TaxExemptActions/index.tsx @@ -1,10 +1,8 @@ -import React, {useMemo, useRef, useState} from 'react'; +import React, {useCallback, useMemo, useRef} from 'react'; import {View} from 'react-native'; -import type {LayoutChangeEvent} from 'react-native'; import * as Expensicons from '@components/Icon/Expensicons'; import ThreeDotsMenu from '@components/ThreeDotsMenu'; import type ThreeDotsMenuProps from '@components/ThreeDotsMenu/types'; -import type {LayoutChangeEventWithTarget} from '@components/ThreeDotsMenu/types'; import useLocalize from '@hooks/useLocalize'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -22,7 +20,6 @@ function TaxExemptActions() { const {shouldUseNarrowLayout} = useResponsiveLayout(); const styles = useThemeStyles(); const {translate} = useLocalize(); - const [threeDotsMenuPosition, setThreeDotsMenuPosition] = useState({horizontal: 0, vertical: 0}); const threeDotsMenuContainerRef = useRef(null); const overflowMenu: ThreeDotsMenuProps['menuItems'] = useMemo( @@ -40,26 +37,29 @@ function TaxExemptActions() { [translate], ); + const calculateAndSetThreeDotsMenuPosition = useCallback(async () => { + if (shouldUseNarrowLayout) { + return {horizontal: 0, vertical: 0}; + } + const position = await new Promise((resolve) => { + threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { + resolve({ + horizontal: x + width, + vertical: y + height, + }); + }); + }); + return position; + }, [shouldUseNarrowLayout]); + return ( { - if (shouldUseNarrowLayout) { - return; - } - const target = e.target || (e as LayoutChangeEventWithTarget).nativeEvent.target; - target?.measureInWindow((x, y, width) => { - setThreeDotsMenuPosition({ - horizontal: x + width, - vertical: y, - }); - }); - }} > diff --git a/src/pages/workspace/WorkspacesListRow.tsx b/src/pages/workspace/WorkspacesListRow.tsx index 64f36589dfbb..6e0a4a168e1e 100644 --- a/src/pages/workspace/WorkspacesListRow.tsx +++ b/src/pages/workspace/WorkspacesListRow.tsx @@ -1,6 +1,6 @@ -import React, {useRef, useState} from 'react'; +import React, {useCallback, useRef} from 'react'; import {View} from 'react-native'; -import type {LayoutChangeEvent, StyleProp, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; import type {ValueOf} from 'type-fest'; import Avatar from '@components/Avatar'; import Badge from '@components/Badge'; @@ -10,7 +10,6 @@ import * as Illustrations from '@components/Icon/Illustrations'; import type {PopoverMenuItem} from '@components/PopoverMenu'; import Text from '@components/Text'; import ThreeDotsMenu from '@components/ThreeDotsMenu'; -import type {LayoutChangeEventWithTarget} from '@components/ThreeDotsMenu/types'; import Tooltip from '@components/Tooltip'; import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; @@ -117,12 +116,26 @@ function WorkspacesListRow({ }: WorkspacesListRowProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); - const [threeDotsMenuPosition, setThreeDotsMenuPosition] = useState({horizontal: 0, vertical: 0}); const threeDotsMenuContainerRef = useRef(null); const {shouldUseNarrowLayout} = useResponsiveLayout(); const ownerDetails = ownerAccountID && getPersonalDetailsByIDs({accountIDs: [ownerAccountID], currentUserAccountID: currentUserPersonalDetails.accountID}).at(0); + const calculateAndSetThreeDotsMenuPosition = useCallback(async () => { + if (shouldUseNarrowLayout) { + return {horizontal: 0, vertical: 0}; + } + const position = await new Promise((resolve) => { + threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { + resolve({ + horizontal: x + width, + vertical: y + height, + }); + }); + }); + return position; + }, [shouldUseNarrowLayout]); + if (layoutWidth === CONST.LAYOUT_WIDTH.NONE) { // To prevent layout from jumping or rendering for a split second, when // isWide is undefined we don't assume anything and simply return null. @@ -166,24 +179,10 @@ function WorkspacesListRow({ - { - if (shouldUseNarrowLayout) { - return; - } - const target = e.target || (e as LayoutChangeEventWithTarget).nativeEvent.target; - target?.measureInWindow((x, y, width) => { - setThreeDotsMenuPosition({ - horizontal: x + width, - vertical: y, - }); - }); - }} - > + ({horizontal: 0, vertical: 0}); const [isDisconnectModalOpen, setIsDisconnectModalOpen] = useState(false); const [datetimeToRelative, setDateTimeToRelative] = useState(''); const threeDotsMenuContainerRef = useRef(null); @@ -193,6 +190,21 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { getAssignedSupportData(policyID); }, [policyID]); + const calculateAndSetThreeDotsMenuPosition = useCallback(async () => { + if (shouldUseNarrowLayout) { + return {horizontal: 0, vertical: 0}; + } + const position = await new Promise((resolve) => { + threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { + resolve({ + horizontal: x + width, + vertical: y + height, + }); + }); + }); + return position; + }, [shouldUseNarrowLayout]); + const integrationSpecificMenuItems = useMemo(() => { const sageIntacctEntityList = policy?.connections?.intacct?.data?.entities ?? []; const netSuiteSubsidiaryList = policy?.connections?.netsuite?.options?.data?.subsidiaryList ?? []; @@ -407,21 +419,10 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { color={theme.spinner} /> ) : ( - { - const target = e.target || (e as LayoutChangeEventWithTarget).nativeEvent.target; - target?.measureInWindow((x, y, width) => { - setThreeDotsMenuPosition({ - horizontal: x + width, - vertical: y, - }); - }); - }} - > + Date: Thu, 6 Mar 2025 16:15:38 +0800 Subject: [PATCH 2/6] lint --- src/components/ThreeDotsMenu/index.tsx | 13 +++++++++---- src/pages/Search/SavedSearchItemThreeDotMenu.tsx | 9 ++++----- .../CardSection/CardSectionActions/index.tsx | 7 +++---- .../Subscription/SubscriptionDetails/index.tsx | 2 +- .../Subscription/TaxExemptActions/index.tsx | 7 +++---- src/pages/workspace/WorkspacesListRow.tsx | 7 +++---- .../workspace/accounting/PolicyAccountingPage.tsx | 7 +++---- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/components/ThreeDotsMenu/index.tsx b/src/components/ThreeDotsMenu/index.tsx index 23bf0492ef1a..e87ada85863f 100644 --- a/src/components/ThreeDotsMenu/index.tsx +++ b/src/components/ThreeDotsMenu/index.tsx @@ -12,7 +12,7 @@ import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import {isMobile} from '@libs/Browser'; -import {AnchorPosition} from '@styles/index'; +import type {AnchorPosition} from '@styles/index'; import variables from '@styles/variables'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -64,7 +64,7 @@ function ThreeDotsMenu({ hidePopoverMenu(); }, [isBehindModal, isPopupMenuVisible]); - const onThreeDotsPress = async () => { + const onThreeDotsPress = () => { if (isPopupMenuVisible) { hidePopoverMenu(); return; @@ -73,9 +73,14 @@ function ThreeDotsMenu({ buttonRef.current?.blur(); if (getAnchorPosition) { - setPosition(await getAnchorPosition()); + getAnchorPosition().then((value) => { + setPosition(value); + showPopoverMenu(); + }); + } else { + showPopoverMenu(); } - showPopoverMenu(); + onIconPress?.(); }; diff --git a/src/pages/Search/SavedSearchItemThreeDotMenu.tsx b/src/pages/Search/SavedSearchItemThreeDotMenu.tsx index 8a76facfe2f5..e5475feaadd5 100644 --- a/src/pages/Search/SavedSearchItemThreeDotMenu.tsx +++ b/src/pages/Search/SavedSearchItemThreeDotMenu.tsx @@ -20,19 +20,18 @@ function SavedSearchItemThreeDotMenu({menuItems, isDisabledItem, hideProductTrai const {shouldUseNarrowLayout} = useResponsiveLayout(); const styles = useThemeStyles(); - const calculateAndSetThreeDotsMenuPosition = useCallback(async () => { + const calculateAndSetThreeDotsMenuPosition = useCallback(() => { if (shouldUseNarrowLayout) { - return {horizontal: 0, vertical: 0}; + return Promise.resolve({horizontal: 0, vertical: 0}); } - const position = await new Promise((resolve) => { - threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { + return new Promise((resolve) => { + threeDotsMenuContainerRef.current?.measureInWindow((x, y, width) => { resolve({ horizontal: x + width, vertical: y, }); }); }); - return position; }, [shouldUseNarrowLayout]); return ( diff --git a/src/pages/settings/Subscription/CardSection/CardSectionActions/index.tsx b/src/pages/settings/Subscription/CardSection/CardSectionActions/index.tsx index ad7a5891b8ea..2563f2955b60 100644 --- a/src/pages/settings/Subscription/CardSection/CardSectionActions/index.tsx +++ b/src/pages/settings/Subscription/CardSection/CardSectionActions/index.tsx @@ -36,11 +36,11 @@ function CardSectionActions() { [translate], ); - const calculateAndSetThreeDotsMenuPosition = useCallback(async () => { + const calculateAndSetThreeDotsMenuPosition = useCallback(() => { if (shouldUseNarrowLayout) { - return {horizontal: 0, vertical: 0}; + return Promise.resolve({horizontal: 0, vertical: 0}); } - const position = await new Promise((resolve) => { + return new Promise((resolve) => { threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { resolve({ horizontal: x + width, @@ -48,7 +48,6 @@ function CardSectionActions() { }); }); }); - return position; }, [shouldUseNarrowLayout]); return ( diff --git a/src/pages/settings/Subscription/SubscriptionDetails/index.tsx b/src/pages/settings/Subscription/SubscriptionDetails/index.tsx index 126ae459e723..88a4212f38bb 100644 --- a/src/pages/settings/Subscription/SubscriptionDetails/index.tsx +++ b/src/pages/settings/Subscription/SubscriptionDetails/index.tsx @@ -107,7 +107,7 @@ function SubscriptionDetails() { /> )} - {!privateTaxExempt && } + {true && } {!!account?.isApprovedAccountant || !!account?.isApprovedAccountantClient ? ( diff --git a/src/pages/settings/Subscription/TaxExemptActions/index.tsx b/src/pages/settings/Subscription/TaxExemptActions/index.tsx index f5de78b38529..919e97c1d447 100644 --- a/src/pages/settings/Subscription/TaxExemptActions/index.tsx +++ b/src/pages/settings/Subscription/TaxExemptActions/index.tsx @@ -37,11 +37,11 @@ function TaxExemptActions() { [translate], ); - const calculateAndSetThreeDotsMenuPosition = useCallback(async () => { + const calculateAndSetThreeDotsMenuPosition = useCallback(() => { if (shouldUseNarrowLayout) { - return {horizontal: 0, vertical: 0}; + return Promise.resolve({horizontal: 0, vertical: 0}); } - const position = await new Promise((resolve) => { + return new Promise((resolve) => { threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { resolve({ horizontal: x + width, @@ -49,7 +49,6 @@ function TaxExemptActions() { }); }); }); - return position; }, [shouldUseNarrowLayout]); return ( diff --git a/src/pages/workspace/WorkspacesListRow.tsx b/src/pages/workspace/WorkspacesListRow.tsx index 6e0a4a168e1e..50730e7cd3d5 100644 --- a/src/pages/workspace/WorkspacesListRow.tsx +++ b/src/pages/workspace/WorkspacesListRow.tsx @@ -121,11 +121,11 @@ function WorkspacesListRow({ const ownerDetails = ownerAccountID && getPersonalDetailsByIDs({accountIDs: [ownerAccountID], currentUserAccountID: currentUserPersonalDetails.accountID}).at(0); - const calculateAndSetThreeDotsMenuPosition = useCallback(async () => { + const calculateAndSetThreeDotsMenuPosition = useCallback(() => { if (shouldUseNarrowLayout) { - return {horizontal: 0, vertical: 0}; + return Promise.resolve({horizontal: 0, vertical: 0}); } - const position = await new Promise((resolve) => { + return new Promise((resolve) => { threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { resolve({ horizontal: x + width, @@ -133,7 +133,6 @@ function WorkspacesListRow({ }); }); }); - return position; }, [shouldUseNarrowLayout]); if (layoutWidth === CONST.LAYOUT_WIDTH.NONE) { diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index bf842efa281e..7861720f3172 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -190,11 +190,11 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { getAssignedSupportData(policyID); }, [policyID]); - const calculateAndSetThreeDotsMenuPosition = useCallback(async () => { + const calculateAndSetThreeDotsMenuPosition = useCallback(() => { if (shouldUseNarrowLayout) { - return {horizontal: 0, vertical: 0}; + return Promise.resolve({horizontal: 0, vertical: 0}); } - const position = await new Promise((resolve) => { + return new Promise((resolve) => { threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { resolve({ horizontal: x + width, @@ -202,7 +202,6 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { }); }); }); - return position; }, [shouldUseNarrowLayout]); const integrationSpecificMenuItems = useMemo(() => { From 8302ac19e147f8b94d8c5fc187cff5e37ef03fa5 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 6 Mar 2025 16:27:56 +0800 Subject: [PATCH 3/6] lint --- .../settings/Subscription/SubscriptionDetails/index.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pages/settings/Subscription/SubscriptionDetails/index.tsx b/src/pages/settings/Subscription/SubscriptionDetails/index.tsx index 88a4212f38bb..be9f392209b8 100644 --- a/src/pages/settings/Subscription/SubscriptionDetails/index.tsx +++ b/src/pages/settings/Subscription/SubscriptionDetails/index.tsx @@ -14,10 +14,10 @@ import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; import useThemeIllustrations from '@hooks/useThemeIllustrations'; import useThemeStyles from '@hooks/useThemeStyles'; +import {clearUpdateSubscriptionSizeError, updateSubscriptionType} from '@libs/actions/Subscription'; import Navigation from '@libs/Navigation/Navigation'; import TaxExemptActions from '@pages/settings/Subscription/TaxExemptActions'; import variables from '@styles/variables'; -import * as Subscription from '@userActions/Subscription'; import type {SubscriptionType} from '@src/CONST'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -57,7 +57,7 @@ function SubscriptionDetails() { return; } - Subscription.updateSubscriptionType(option); + updateSubscriptionType(option); }; const onSubscriptionSizePress = () => { @@ -75,9 +75,7 @@ function SubscriptionDetails() { { - Subscription.clearUpdateSubscriptionSizeError(); - }} + onClose={clearUpdateSubscriptionSizeError} > Date: Mon, 31 Mar 2025 12:41:24 +0800 Subject: [PATCH 4/6] revert unexpected changes --- src/pages/settings/Subscription/SubscriptionDetails/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Subscription/SubscriptionDetails/index.tsx b/src/pages/settings/Subscription/SubscriptionDetails/index.tsx index be9f392209b8..cde1eb5449b9 100644 --- a/src/pages/settings/Subscription/SubscriptionDetails/index.tsx +++ b/src/pages/settings/Subscription/SubscriptionDetails/index.tsx @@ -105,7 +105,7 @@ function SubscriptionDetails() { /> )} - {true && } + {!privateTaxExempt && } {!!account?.isApprovedAccountant || !!account?.isApprovedAccountantClient ? ( From 67eee8b8d5f14e60c2d95bac56ebe5f2dfc94af6 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Mon, 31 Mar 2025 22:01:12 +0800 Subject: [PATCH 5/6] update type --- src/components/ThreeDotsMenu/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ThreeDotsMenu/types.ts b/src/components/ThreeDotsMenu/types.ts index 03d92f8090df..3e5dd58495b5 100644 --- a/src/components/ThreeDotsMenu/types.ts +++ b/src/components/ThreeDotsMenu/types.ts @@ -55,11 +55,11 @@ type ThreeDotsMenuWithOptionalAnchorProps = anchorPosition: AnchorPosition; /** A callback to get the anchor position dynamically */ - getAnchorPosition?: () => Promise; + getAnchorPosition?: never; }) | (ThreeDotsMenuProps & { /** The anchor position of the menu */ - anchorPosition?: AnchorPosition; + anchorPosition?: never; /** A callback to get the anchor position dynamically */ getAnchorPosition: () => Promise; From 61ed05eca6580bf0e8624a8250dbc45c0f529a3e Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 3 Apr 2025 21:07:54 +0800 Subject: [PATCH 6/6] prettier --- src/pages/workspace/WorkspacesListRow.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspacesListRow.tsx b/src/pages/workspace/WorkspacesListRow.tsx index e1d0f38f2d32..3f1c5e2c03b2 100644 --- a/src/pages/workspace/WorkspacesListRow.tsx +++ b/src/pages/workspace/WorkspacesListRow.tsx @@ -1,5 +1,5 @@ -import React, {useCallback, useRef} from 'react'; import {Str} from 'expensify-common'; +import React, {useCallback, useRef} from 'react'; import {View} from 'react-native'; import type {StyleProp, ViewStyle} from 'react-native'; import type {ValueOf} from 'type-fest';