diff --git a/src/CONST.ts b/src/CONST.ts index cfccbfd12ff1d..c1b845cfa490a 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -6806,11 +6806,10 @@ 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', diff --git a/src/components/LHNOptionsList/OptionRowLHN.tsx b/src/components/LHNOptionsList/OptionRowLHN.tsx index a4e0164e388b1..c28a20d01a35e 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.tsx +++ b/src/components/LHNOptionsList/OptionRowLHN.tsx @@ -70,6 +70,8 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti const isReportsSplitNavigatorLast = useRootNavigationState((state) => state?.routes?.at(-1)?.name === NAVIGATORS.REPORTS_SPLIT_NAVIGATOR); const {tooltipToRender, shouldShowTooltip} = useMemo(() => { + // TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room + // https://github.com/Expensify/App/issues/57045#issuecomment-2701455668 const tooltip = shouldShowGetStartedTooltip ? CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCEIRGE_LHN_GBR : CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.LHN_WORKSPACE_CHAT_TOOLTIP; const shouldShowTooltips = shouldShowWokspaceChatTooltip || shouldShowGetStartedTooltip; const shouldTooltipBeVisible = shouldUseNarrowLayout ? isScreenFocused && isReportsSplitNavigatorLast : isReportsSplitNavigatorLast && !isFullscreenVisible; @@ -194,8 +196,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/ProductTrainingContext/TOOLTIPS.ts b/src/components/ProductTrainingContext/TOOLTIPS.ts index 90e91166fba76..b0bed79b96e39 100644 --- a/src/components/ProductTrainingContext/TOOLTIPS.ts +++ b/src/components/ProductTrainingContext/TOOLTIPS.ts @@ -6,9 +6,6 @@ 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, @@ -41,7 +38,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: [ @@ -64,37 +63,6 @@ const TOOLTIPS: Record = { priority: 1200, shouldShow: () => true, }, - [QUICK_ACTION_BUTTON]: { - content: [ - {text: 'productTrainingTooltip.quickActionButton.part1', isBold: true}, - {text: 'productTrainingTooltip.quickActionButton.part2', isBold: false}, - ], - onHideTooltip: () => dismissProductTraining(QUICK_ACTION_BUTTON), - name: QUICK_ACTION_BUTTON, - priority: 1150, - shouldShow: () => true, - }, - [WORKSAPCE_CHAT_CREATE]: { - content: [ - {text: 'productTrainingTooltip.workspaceChatCreate.part1', isBold: false}, - {text: 'productTrainingTooltip.workspaceChatCreate.part2', isBold: true}, - {text: 'productTrainingTooltip.workspaceChatCreate.part3', isBold: false}, - ], - onHideTooltip: () => dismissProductTraining(WORKSAPCE_CHAT_CREATE), - name: WORKSAPCE_CHAT_CREATE, - priority: 1100, - shouldShow: () => true, - }, - [SEARCH_FILTER_BUTTON_TOOLTIP]: { - content: [ - {text: 'productTrainingTooltip.searchFilterButtonTooltip.part1', isBold: true}, - {text: 'productTrainingTooltip.searchFilterButtonTooltip.part2', isBold: false}, - ], - onHideTooltip: () => dismissProductTraining(SEARCH_FILTER_BUTTON_TOOLTIP), - name: SEARCH_FILTER_BUTTON_TOOLTIP, - priority: 1000, - shouldShow: () => true, - }, [BOTTOM_NAV_INBOX_TOOLTIP]: { content: [ {text: 'productTrainingTooltip.bottomNavInboxTooltip.part1', isBold: true}, diff --git a/src/components/ProductTrainingContext/index.tsx b/src/components/ProductTrainingContext/index.tsx index ca365949a0054..449a54abe1f61 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 fba02f066e7f2..3e3c3f9d4259b 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 ( - -