diff --git a/src/CONST.ts b/src/CONST.ts index cfccbfd12ff1..ca117e9f5057 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -6806,17 +6806,19 @@ const CONST = { BASE_LIST_ITEM_TEST_ID: 'base-list-item-', PRODUCT_TRAINING_TOOLTIP_NAMES: { + // TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room + // https://github.com/Expensify/App/issues/57045#issuecomment-2701455668 CONCEIRGE_LHN_GBR: 'conciergeLHNGBR', RENAME_SAVED_SEARCH: 'renameSavedSearch', - QUICK_ACTION_BUTTON: 'quickActionButton', - WORKSAPCE_CHAT_CREATE: 'workspaceChatCreate', - SEARCH_FILTER_BUTTON_TOOLTIP: 'filterButtonTooltip', BOTTOM_NAV_INBOX_TOOLTIP: 'bottomNavInboxTooltip', LHN_WORKSPACE_CHAT_TOOLTIP: 'workspaceChatLHNTooltip', GLOBAL_CREATE_TOOLTIP: 'globalCreateTooltip', SCAN_TEST_TOOLTIP: 'scanTestTooltip', SCAN_TEST_TOOLTIP_MANAGER: 'scanTestTooltipManager', SCAN_TEST_CONFIRMATION: 'scanTestConfirmation', + EXPENSE_REPORTS_FILTER: 'expenseReportsFilter', + GBR_RBR_CHAT: 'chatGBRRBR', + ACCOUNT_SWITCHER: 'accountSwitcher', }, CHANGE_POLICY_TRAINING_MODAL: 'changePolicyModal', SMART_BANNER_HEIGHT: 152, diff --git a/src/components/AccountSwitcher.tsx b/src/components/AccountSwitcher.tsx index ed2eae7a0a4c..ea4eec229056 100644 --- a/src/components/AccountSwitcher.tsx +++ b/src/components/AccountSwitcher.tsx @@ -10,11 +10,11 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import {clearDelegatorErrors, connect, disconnect} from '@libs/actions/Delegate'; -import * as EmojiUtils from '@libs/EmojiUtils'; -import * as ErrorUtils from '@libs/ErrorUtils'; -import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; +import {getProcessedText, splitTextWithEmojis} from '@libs/EmojiUtils'; +import {getLatestError} from '@libs/ErrorUtils'; +import {getPersonalDetailByEmail} from '@libs/PersonalDetailsUtils'; import variables from '@styles/variables'; -import * as Modal from '@userActions/Modal'; +import {close} from '@userActions/Modal'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {PersonalDetails} from '@src/types/onyx'; @@ -26,7 +26,9 @@ import * as Expensicons from './Icon/Expensicons'; import type {PopoverMenuItem} from './PopoverMenu'; import PopoverMenu from './PopoverMenu'; import {PressableWithFeedback} from './Pressable'; +import {useProductTrainingContext} from './ProductTrainingContext'; import Text from './Text'; +import EducationalTooltip from './Tooltip/EducationalTooltip'; function AccountSwitcher() { const currentUserPersonalDetails = useCurrentUserPersonalDetails(); @@ -47,7 +49,12 @@ function AccountSwitcher() { const isActingAsDelegate = !!account?.delegatedAccess?.delegate ?? false; const canSwitchAccounts = delegators.length > 0 || isActingAsDelegate; - const processedTextArray = EmojiUtils.splitTextWithEmojis(currentUserPersonalDetails?.displayName); + const processedTextArray = splitTextWithEmojis(currentUserPersonalDetails?.displayName); + + const {shouldShowProductTrainingTooltip, renderProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext( + CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.ACCOUNT_SWITCHER, + canSwitchAccounts, + ); const createBaseMenuItem = ( personalDetails: PersonalDetails | undefined, @@ -58,7 +65,7 @@ function AccountSwitcher() { return { text: personalDetails?.displayName ?? personalDetails?.login ?? '', description: Str.removeSMSDomain(personalDetails?.login ?? ''), - avatarID: personalDetails?.accountID ?? -1, + avatarID: personalDetails?.accountID ?? CONST.DEFAULT_NUMBER_ID, icon: personalDetails?.avatar ?? '', iconType: CONST.ICON_TYPE_AVATAR, outerWrapperStyle: shouldUseNarrowLayout ? {} : styles.accountSwitcherPopover, @@ -86,14 +93,14 @@ function AccountSwitcher() { return [currentUserMenuItem]; } - const delegatePersonalDetails = PersonalDetailsUtils.getPersonalDetailByEmail(delegateEmail); - const error = ErrorUtils.getLatestError(account?.delegatedAccess?.errorFields?.disconnect); + const delegatePersonalDetails = getPersonalDetailByEmail(delegateEmail); + const error = getLatestError(account?.delegatedAccess?.errorFields?.disconnect); return [ createBaseMenuItem(delegatePersonalDetails, error, { onSelected: () => { if (isOffline) { - Modal.close(() => setShouldShowOfflineModal(true)); + close(() => setShouldShowOfflineModal(true)); return; } disconnect(); @@ -107,13 +114,13 @@ function AccountSwitcher() { .filter(({email}) => email !== currentUserPersonalDetails.login) .map(({email, role}) => { const errorFields = account?.delegatedAccess?.errorFields ?? {}; - const error = ErrorUtils.getLatestError(errorFields?.connect?.[email]); - const personalDetails = PersonalDetailsUtils.getPersonalDetailByEmail(email); + const error = getLatestError(errorFields?.connect?.[email]); + const personalDetails = getPersonalDetailByEmail(email); return createBaseMenuItem(personalDetails, error, { badgeText: translate('delegate.role', {role}), onSelected: () => { if (isOffline) { - Modal.close(() => setShouldShowOfflineModal(true)); + close(() => setShouldShowOfflineModal(true)); return; } connect(email); @@ -124,65 +131,81 @@ function AccountSwitcher() { return [currentUserMenuItem, ...delegatorMenuItems]; }; + const onPressSwitcher = () => { + hideProductTrainingTooltip(); + setShouldShowDelegatorMenu(!shouldShowDelegatorMenu); + }; + return ( <> - { - setShouldShowDelegatorMenu(!shouldShowDelegatorMenu); + - - - - + + + + + + + {processedTextArray.length !== 0 ? getProcessedText(processedTextArray, styles.initialSettingsUsernameEmoji) : currentUserPersonalDetails?.displayName} + + {!!canSwitchAccounts && ( + + + + )} + - {processedTextArray.length !== 0 - ? EmojiUtils.getProcessedText(processedTextArray, styles.initialSettingsUsernameEmoji) - : currentUserPersonalDetails?.displayName} + {Str.removeSMSDomain(currentUserPersonalDetails?.login ?? '')} - {!!canSwitchAccounts && ( - - - + {!!user?.isDebugModeEnabled && ( + + AccountID: {session?.accountID} + )} - - {Str.removeSMSDomain(currentUserPersonalDetails?.login ?? '')} - - {!!user?.isDebugModeEnabled && ( - - AccountID: {session?.accountID} - - )} - - + + + {!!canSwitchAccounts && ( { + if (!shouldShowProductTrainingTooltip) { + return undefined; + } + return data.find((reportID) => { + const itemFullReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; + const itemReportActions = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`]; + if (!itemFullReport) { + return false; + } + if (hasReportErrors(itemFullReport, itemReportActions)) { + return true; + } + const itemParentReportActions = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${itemFullReport?.parentReportID}`]; + const itemParentReportAction = itemFullReport?.parentReportActionID ? itemParentReportActions?.[itemFullReport?.parentReportActionID] : undefined; + const hasGBR = requiresAttentionFromCurrentUser(itemFullReport, itemParentReportAction); + return hasGBR; + }); + }, [shouldShowProductTrainingTooltip, data, reportActions, reports]); + // When the first item renders we want to call the onFirstItemRendered callback. // At this point in time we know that the list is actually displaying items. const hasCalledOnLayout = React.useRef(false); @@ -179,6 +201,8 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio } const lastMessageTextFromReport = getLastMessageTextForReport(itemFullReport, lastActorDetails, itemPolicy); + const shouldShowRBRorGPRTooltip = firstReportIDWithGBRorRGR === reportID; + return ( ); }, @@ -220,6 +245,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio transactionViolations, onLayoutItem, isOffline, + firstReportIDWithGBRorRGR, ], ); diff --git a/src/components/LHNOptionsList/OptionRowLHN.tsx b/src/components/LHNOptionsList/OptionRowLHN.tsx index a4e0164e388b..90d1e6544997 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.tsx +++ b/src/components/LHNOptionsList/OptionRowLHN.tsx @@ -12,6 +12,7 @@ import OfflineWithFeedback from '@components/OfflineWithFeedback'; import {useSession} from '@components/OnyxProvider'; import PressableWithSecondaryInteraction from '@components/PressableWithSecondaryInteraction'; import {useProductTrainingContext} from '@components/ProductTrainingContext'; +import type {ProductTrainingTooltipName} from '@components/ProductTrainingContext/TOOLTIPS'; import SubscriptAvatar from '@components/SubscriptAvatar'; import Text from '@components/Text'; import Tooltip from '@components/Tooltip'; @@ -49,7 +50,17 @@ import ONYXKEYS from '@src/ONYXKEYS'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; import type {OptionRowLHNProps} from './types'; -function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, optionItem, viewMode = 'default', style, onLayout = () => {}, hasDraftComment}: OptionRowLHNProps) { +function OptionRowLHN({ + reportID, + isFocused = false, + onSelectRow = () => {}, + optionItem, + viewMode = 'default', + style, + onLayout = () => {}, + hasDraftComment, + shouldShowRBRorGPRTooltip, +}: OptionRowLHNProps) { const theme = useTheme(); const styles = useThemeStyles(); const popoverAnchor = useRef(null); @@ -70,13 +81,22 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti const isReportsSplitNavigatorLast = useRootNavigationState((state) => state?.routes?.at(-1)?.name === NAVIGATORS.REPORTS_SPLIT_NAVIGATOR); const {tooltipToRender, shouldShowTooltip} = useMemo(() => { - const tooltip = shouldShowGetStartedTooltip ? CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCEIRGE_LHN_GBR : CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.LHN_WORKSPACE_CHAT_TOOLTIP; - const shouldShowTooltips = shouldShowWokspaceChatTooltip || shouldShowGetStartedTooltip; + let tooltip: ProductTrainingTooltipName; + // TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room + // https://github.com/Expensify/App/issues/57045#issuecomment-2701455668 + tooltip = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCEIRGE_LHN_GBR; + if (shouldShowWokspaceChatTooltip) { + tooltip = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.LHN_WORKSPACE_CHAT_TOOLTIP; + } + if (shouldShowRBRorGPRTooltip) { + tooltip = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.GBR_RBR_CHAT; + } + const shouldShowTooltips = shouldShowRBRorGPRTooltip || shouldShowWokspaceChatTooltip || shouldShowGetStartedTooltip; const shouldTooltipBeVisible = shouldUseNarrowLayout ? isScreenFocused && isReportsSplitNavigatorLast : isReportsSplitNavigatorLast && !isFullscreenVisible; // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing return {tooltipToRender: tooltip, shouldShowTooltip: shouldShowTooltips && shouldTooltipBeVisible}; - }, [shouldShowGetStartedTooltip, shouldShowWokspaceChatTooltip, isScreenFocused, shouldUseNarrowLayout, isReportsSplitNavigatorLast, isFullscreenVisible]); + }, [shouldShowRBRorGPRTooltip, shouldShowGetStartedTooltip, shouldShowWokspaceChatTooltip, isScreenFocused, shouldUseNarrowLayout, isReportsSplitNavigatorLast, isFullscreenVisible]); const {shouldShowProductTrainingTooltip, renderProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext(tooltipToRender, shouldShowTooltip); @@ -194,8 +214,8 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti horizontal: shouldShowWokspaceChatTooltip ? CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT : CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, }} - shiftHorizontal={shouldShowWokspaceChatTooltip ? variables.workspaceLHNtooltipShiftHorizontal : variables.gbrTooltipShiftHorizontal} - shiftVertical={shouldShowWokspaceChatTooltip ? 0 : variables.composerTooltipShiftVertical} + shiftHorizontal={shouldShowWokspaceChatTooltip ? variables.workspaceLHNTooltipShiftHorizontal : variables.gbrTooltipShiftHorizontal} + shiftVertical={shouldShowWokspaceChatTooltip ? 0 : variables.gbrTooltipShiftVertical} wrapperStyle={styles.productTrainingTooltipWrapper} onTooltipPress={onOptionPress} shouldHideOnScroll diff --git a/src/components/LHNOptionsList/types.ts b/src/components/LHNOptionsList/types.ts index 597523dd522a..e631b537e134 100644 --- a/src/components/LHNOptionsList/types.ts +++ b/src/components/LHNOptionsList/types.ts @@ -102,6 +102,9 @@ type OptionRowLHNDataProps = { /** Callback to execute when the OptionList lays out */ onLayout?: (event: LayoutChangeEvent) => void; + + /** Whether to show the educational tooltip for the GBR or RBR */ + shouldShowRBRorGPRTooltip: boolean; }; type OptionRowLHNProps = { @@ -127,6 +130,9 @@ type OptionRowLHNProps = { hasDraftComment: boolean; onLayout?: (event: LayoutChangeEvent) => void; + + /** Whether to show the educational tooltip on the GBR or RBR */ + shouldShowRBRorGPRTooltip: boolean; }; type RenderItemProps = {item: string}; diff --git a/src/components/ProductTrainingContext/TOOLTIPS.ts b/src/components/ProductTrainingContext/TOOLTIPS.ts index 90e91166fba7..fbf0761dc1e6 100644 --- a/src/components/ProductTrainingContext/TOOLTIPS.ts +++ b/src/components/ProductTrainingContext/TOOLTIPS.ts @@ -6,15 +6,15 @@ import type {TranslationPaths} from '@src/languages/types'; const { CONCEIRGE_LHN_GBR, RENAME_SAVED_SEARCH, - WORKSAPCE_CHAT_CREATE, - QUICK_ACTION_BUTTON, - SEARCH_FILTER_BUTTON_TOOLTIP, BOTTOM_NAV_INBOX_TOOLTIP, LHN_WORKSPACE_CHAT_TOOLTIP, GLOBAL_CREATE_TOOLTIP, SCAN_TEST_TOOLTIP, SCAN_TEST_TOOLTIP_MANAGER, SCAN_TEST_CONFIRMATION, + EXPENSE_REPORTS_FILTER, + GBR_RBR_CHAT, + ACCOUNT_SWITCHER, } = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES; type ProductTrainingTooltipName = ValueOf; @@ -41,7 +41,9 @@ const TOOLTIPS: Record = { onHideTooltip: () => dismissProductTraining(CONCEIRGE_LHN_GBR), name: CONCEIRGE_LHN_GBR, priority: 1300, - shouldShow: ({shouldUseNarrowLayout}) => !!shouldUseNarrowLayout, + // TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room + // https://github.com/Expensify/App/issues/57045#issuecomment-2701455668 + shouldShow: () => false, }, [RENAME_SAVED_SEARCH]: { content: [ @@ -61,60 +63,63 @@ const TOOLTIPS: Record = { ], onHideTooltip: () => dismissProductTraining(GLOBAL_CREATE_TOOLTIP), name: GLOBAL_CREATE_TOOLTIP, - priority: 1200, + priority: 1950, shouldShow: () => true, }, - [QUICK_ACTION_BUTTON]: { + [BOTTOM_NAV_INBOX_TOOLTIP]: { content: [ - {text: 'productTrainingTooltip.quickActionButton.part1', isBold: true}, - {text: 'productTrainingTooltip.quickActionButton.part2', isBold: false}, + {text: 'productTrainingTooltip.bottomNavInboxTooltip.part1', isBold: false}, + {text: 'productTrainingTooltip.bottomNavInboxTooltip.part2', isBold: true}, + {text: 'productTrainingTooltip.bottomNavInboxTooltip.part3', isBold: false}, + {text: 'productTrainingTooltip.bottomNavInboxTooltip.part4', isBold: true}, ], - onHideTooltip: () => dismissProductTraining(QUICK_ACTION_BUTTON), - name: QUICK_ACTION_BUTTON, - priority: 1150, + onHideTooltip: () => dismissProductTraining(BOTTOM_NAV_INBOX_TOOLTIP), + name: BOTTOM_NAV_INBOX_TOOLTIP, + priority: 1700, shouldShow: () => true, }, - [WORKSAPCE_CHAT_CREATE]: { + [LHN_WORKSPACE_CHAT_TOOLTIP]: { content: [ - {text: 'productTrainingTooltip.workspaceChatCreate.part1', isBold: false}, - {text: 'productTrainingTooltip.workspaceChatCreate.part2', isBold: true}, - {text: 'productTrainingTooltip.workspaceChatCreate.part3', isBold: false}, + {text: 'productTrainingTooltip.workspaceChatTooltip.part1', isBold: false}, + {text: 'productTrainingTooltip.workspaceChatTooltip.part2', isBold: true}, ], - onHideTooltip: () => dismissProductTraining(WORKSAPCE_CHAT_CREATE), - name: WORKSAPCE_CHAT_CREATE, - priority: 1100, + onHideTooltip: () => dismissProductTraining(LHN_WORKSPACE_CHAT_TOOLTIP), + name: LHN_WORKSPACE_CHAT_TOOLTIP, + priority: 1800, shouldShow: () => true, }, - [SEARCH_FILTER_BUTTON_TOOLTIP]: { + [EXPENSE_REPORTS_FILTER]: { content: [ - {text: 'productTrainingTooltip.searchFilterButtonTooltip.part1', isBold: true}, - {text: 'productTrainingTooltip.searchFilterButtonTooltip.part2', isBold: false}, + {text: 'productTrainingTooltip.expenseReportsFilter.part1', isBold: false}, + {text: 'productTrainingTooltip.expenseReportsFilter.part2', isBold: true}, + {text: 'productTrainingTooltip.expenseReportsFilter.part3', isBold: false}, ], - onHideTooltip: () => dismissProductTraining(SEARCH_FILTER_BUTTON_TOOLTIP), - name: SEARCH_FILTER_BUTTON_TOOLTIP, - priority: 1000, - shouldShow: () => true, + onHideTooltip: () => dismissProductTraining(EXPENSE_REPORTS_FILTER), + name: EXPENSE_REPORTS_FILTER, + priority: 2000, + shouldShow: ({shouldUseNarrowLayout}) => !shouldUseNarrowLayout, }, - [BOTTOM_NAV_INBOX_TOOLTIP]: { + [GBR_RBR_CHAT]: { content: [ - {text: 'productTrainingTooltip.bottomNavInboxTooltip.part1', isBold: true}, - {text: 'productTrainingTooltip.bottomNavInboxTooltip.part2', isBold: false}, - {text: 'productTrainingTooltip.bottomNavInboxTooltip.part3', isBold: false}, + {text: 'productTrainingTooltip.GBRRBRChat.part1', isBold: false}, + {text: 'productTrainingTooltip.GBRRBRChat.part2', isBold: true}, + {text: 'productTrainingTooltip.GBRRBRChat.part3', isBold: false}, + {text: 'productTrainingTooltip.GBRRBRChat.part4', isBold: true}, ], - onHideTooltip: () => dismissProductTraining(BOTTOM_NAV_INBOX_TOOLTIP), - name: BOTTOM_NAV_INBOX_TOOLTIP, - priority: 900, + onHideTooltip: () => dismissProductTraining(GBR_RBR_CHAT), + name: GBR_RBR_CHAT, + priority: 1900, shouldShow: () => true, }, - [LHN_WORKSPACE_CHAT_TOOLTIP]: { + [ACCOUNT_SWITCHER]: { content: [ - {text: 'productTrainingTooltip.workspaceChatTooltip.part1', isBold: true}, - {text: 'productTrainingTooltip.workspaceChatTooltip.part2', isBold: false}, - {text: 'productTrainingTooltip.workspaceChatTooltip.part3', isBold: false}, + {text: 'productTrainingTooltip.accountSwitcher.part1', isBold: false}, + {text: 'productTrainingTooltip.accountSwitcher.part2', isBold: true}, + {text: 'productTrainingTooltip.accountSwitcher.part3', isBold: false}, ], - onHideTooltip: () => dismissProductTraining(LHN_WORKSPACE_CHAT_TOOLTIP), - name: LHN_WORKSPACE_CHAT_TOOLTIP, - priority: 800, + onHideTooltip: () => dismissProductTraining(ACCOUNT_SWITCHER), + name: ACCOUNT_SWITCHER, + priority: 1600, shouldShow: () => true, }, [SCAN_TEST_TOOLTIP]: { diff --git a/src/components/ProductTrainingContext/index.tsx b/src/components/ProductTrainingContext/index.tsx index ca365949a005..449a54abe1f6 100644 --- a/src/components/ProductTrainingContext/index.tsx +++ b/src/components/ProductTrainingContext/index.tsx @@ -101,9 +101,8 @@ function ProductTrainingContextProvider({children}: ChildrenProps) { return false; } - // We need to make an exception for the QAB tooltip because it is shown in a modal, otherwise it would be hidden if a modal is visible + // We need to make an exception for these tooltips because it is shown in a modal, otherwise it would be hidden if a modal is visible if ( - tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.QUICK_ACTION_BUTTON && tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP && tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP_MANAGER && tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_CONFIRMATION && diff --git a/src/components/Search/SearchPageHeader/SearchPageHeader.tsx b/src/components/Search/SearchPageHeader/SearchPageHeader.tsx index fba02f066e7f..3e3c3f9d4259 100644 --- a/src/components/Search/SearchPageHeader/SearchPageHeader.tsx +++ b/src/components/Search/SearchPageHeader/SearchPageHeader.tsx @@ -1,15 +1,12 @@ -import {useFocusEffect} from '@react-navigation/native'; -import React, {useCallback, useMemo, useState} from 'react'; +import React, {useCallback, useMemo} from 'react'; import {View} from 'react-native'; import {useOnyx} from 'react-native-onyx'; import Button from '@components/Button'; import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types'; import * as Expensicons from '@components/Icon/Expensicons'; import {usePersonalDetails} from '@components/OnyxProvider'; -import {useProductTrainingContext} from '@components/ProductTrainingContext'; import {useSearchContext} from '@components/Search/SearchContext'; import type {SearchQueryJSON} from '@components/Search/types'; -import EducationalTooltip from '@components/Tooltip/EducationalTooltip'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useThemeStyles from '@hooks/useThemeStyles'; import {updateAdvancedFilters} from '@libs/actions/Search'; @@ -18,7 +15,6 @@ import Navigation from '@libs/Navigation/Navigation'; import {getAllTaxRates} from '@libs/PolicyUtils'; import {buildFilterFormValuesFromQuery} from '@libs/SearchQueryUtils'; import SearchSelectedNarrow from '@pages/Search/SearchSelectedNarrow'; -import variables from '@styles/variables'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -50,62 +46,25 @@ function SearchPageHeader({queryJSON, searchName, searchRouterListVisible, hideS const [currencyList = {}] = useOnyx(ONYXKEYS.CURRENCY_LIST); const [policyCategories] = useOnyx(ONYXKEYS.COLLECTION.POLICY_CATEGORIES); const [policyTagsLists] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS); - const [isScreenFocused, setIsScreenFocused] = useState(false); - - const {renderProductTrainingTooltip, shouldShowProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext( - CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SEARCH_FILTER_BUTTON_TOOLTIP, - isScreenFocused, - ); - - useFocusEffect( - useCallback(() => { - setIsScreenFocused(true); - return () => { - setIsScreenFocused(false); - }; - }, []), - ); const selectedTransactionsKeys = Object.keys(selectedTransactions ?? {}); const onFiltersButtonPress = useCallback(() => { - hideProductTrainingTooltip(); const filterFormValues = buildFilterFormValuesFromQuery(queryJSON, policyCategories, policyTagsLists, currencyList, personalDetails, allCards, reports, taxRates); updateAdvancedFilters(filterFormValues); Navigation.navigate(ROUTES.SEARCH_ADVANCED_FILTERS); - }, [allCards, currencyList, hideProductTrainingTooltip, personalDetails, policyCategories, policyTagsLists, queryJSON, reports, taxRates]); + }, [allCards, currencyList, personalDetails, policyCategories, policyTagsLists, queryJSON, reports, taxRates]); const InputRightComponent = useMemo(() => { return ( - -