From ede3c262e0648bd86e9cbf15eaece2bca4b00c35 Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Tue, 17 Dec 2024 14:41:57 -0500 Subject: [PATCH 1/3] Revert 54064 --- src/CONST.ts | 4 - src/components/FloatingActionButton.tsx | 75 ++++------- .../LHNOptionsList/OptionRowLHN.tsx | 33 +++-- .../PRODUCT_TRAINING_TOOLTIP_DATA.ts | 67 ++++++++++ .../ProductTrainingContext/TOOLTIPS.ts | 118 ------------------ .../ProductTrainingContext/index.tsx | 46 +++---- src/components/Search/SearchPageHeader.tsx | 33 +---- .../BaseEducationalTooltip.tsx | 9 +- src/hooks/useBottomTabIsFocused.ts | 26 ---- src/hooks/useOnboardingFlow.ts | 6 +- src/languages/en.ts | 19 --- src/languages/es.ts | 19 --- .../BottomTabBar.tsx | 75 ++++------- src/libs/Permissions.ts | 6 + src/pages/Search/SearchTypeMenu.tsx | 9 +- src/pages/Search/SearchTypeMenuNarrow.tsx | 31 +---- .../FloatingActionButtonAndPopover.tsx | 3 +- src/styles/index.ts | 12 +- src/styles/theme/themes/dark.ts | 2 +- src/styles/theme/themes/light.ts | 2 +- src/styles/variables.ts | 6 - src/types/onyx/DismissedProductTraining.ts | 31 +---- 22 files changed, 183 insertions(+), 449 deletions(-) create mode 100644 src/components/ProductTrainingContext/PRODUCT_TRAINING_TOOLTIP_DATA.ts delete mode 100644 src/components/ProductTrainingContext/TOOLTIPS.ts delete mode 100644 src/hooks/useBottomTabIsFocused.ts diff --git a/src/CONST.ts b/src/CONST.ts index 5d2331b6b304..bb080325ce26 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -6443,10 +6443,6 @@ const CONST = { 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', }, } as const; diff --git a/src/components/FloatingActionButton.tsx b/src/components/FloatingActionButton.tsx index e0f0ff4e6dcd..3c831301db8b 100644 --- a/src/components/FloatingActionButton.tsx +++ b/src/components/FloatingActionButton.tsx @@ -5,16 +5,10 @@ import type {GestureResponderEvent, Role, Text, View} from 'react-native'; import {Platform} from 'react-native'; import Animated, {createAnimatedPropAdapter, Easing, interpolateColor, processColor, useAnimatedProps, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; import Svg, {Path} from 'react-native-svg'; -import useBottomTabIsFocused from '@hooks/useBottomTabIsFocused'; -import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import getPlatform from '@libs/getPlatform'; import variables from '@styles/variables'; -import CONST from '@src/CONST'; import {PressableWithoutFeedback} from './Pressable'; -import {useProductTrainingContext} from './ProductTrainingContext'; -import EducationalTooltip from './Tooltip/EducationalTooltip'; const AnimatedPath = Animated.createAnimatedComponent(Path); AnimatedPath.displayName = 'AnimatedPath'; @@ -62,14 +56,6 @@ function FloatingActionButton({onPress, isActive, accessibilityLabel, role}: Flo const styles = useThemeStyles(); const borderRadius = styles.floatingActionButton.borderRadius; const fabPressable = useRef(null); - const {shouldUseNarrowLayout} = useResponsiveLayout(); - const platform = getPlatform(); - const isNarrowScreenOnWeb = shouldUseNarrowLayout && platform === CONST.PLATFORM.WEB; - const isFocused = useBottomTabIsFocused(); - const {renderProductTrainingTooltip, shouldShowProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext( - CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.GLOBAL_CREATE_TOOLTIP, - isFocused, - ); const sharedValue = useSharedValue(isActive ? 1 : 0); const buttonRef = ref; @@ -111,45 +97,32 @@ function FloatingActionButton({onPress, isActive, accessibilityLabel, role}: Flo }; return ( - { + fabPressable.current = el ?? null; + if (buttonRef && 'current' in buttonRef) { + buttonRef.current = el ?? null; + } }} - shouldUseOverlay - shiftHorizontal={isNarrowScreenOnWeb ? 0 : variables.fabTooltipShiftHorizontal} - renderTooltipContent={renderProductTrainingTooltip} - wrapperStyle={styles.productTrainingTooltipWrapper} - onHideTooltip={hideProductTrainingTooltip} + style={[styles.h100, styles.bottomTabBarItem]} + accessibilityLabel={accessibilityLabel} + onPress={toggleFabAction} + onLongPress={() => {}} + role={role} + shouldUseHapticsOnLongPress={false} > - { - fabPressable.current = el ?? null; - if (buttonRef && 'current' in buttonRef) { - buttonRef.current = el ?? null; - } - }} - style={[styles.h100, styles.bottomTabBarItem]} - accessibilityLabel={accessibilityLabel} - onPress={toggleFabAction} - onLongPress={() => {}} - role={role} - shouldUseHapticsOnLongPress={false} - > - - - - - - - + + + + + + ); } diff --git a/src/components/LHNOptionsList/OptionRowLHN.tsx b/src/components/LHNOptionsList/OptionRowLHN.tsx index efdd9659c845..6b8cf173b0fd 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.tsx +++ b/src/components/LHNOptionsList/OptionRowLHN.tsx @@ -1,5 +1,5 @@ import {useFocusEffect} from '@react-navigation/native'; -import React, {useCallback, useMemo, useRef, useState} from 'react'; +import React, {useCallback, useRef, useState} from 'react'; import type {GestureResponderEvent, ViewStyle} from 'react-native'; import {StyleSheet, View} from 'react-native'; import {useOnyx} from 'react-native-onyx'; @@ -47,21 +47,19 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${optionItem?.reportID || -1}`); - const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); - const isActiveWorkspaceChat = ReportUtils.isPolicyExpenseChat(report) && report?.isOwnPolicyExpenseChat && activePolicyID === report?.policyID; + const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const session = useSession(); - const isOnboardingGuideAssigned = introSelected?.choice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !session?.email?.includes('+'); - const shouldShowGetStartedTooltip = isOnboardingGuideAssigned ? ReportUtils.isAdminRoom(report) : ReportUtils.isConciergeChatReport(report); - - const {tooltipToRender, shouldShowTooltip} = useMemo(() => { - const tooltip = shouldShowGetStartedTooltip ? CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCEIRGE_LHN_GBR : CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.LHN_WORKSPACE_CHAT_TOOLTIP; - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - return {tooltipToRender: tooltip, shouldShowTooltip: shouldUseNarrowLayout ? isScreenFocused : true}; - }, [shouldShowGetStartedTooltip, isScreenFocused, shouldUseNarrowLayout]); + // Guides are assigned for the MANAGE_TEAM onboarding action, except for emails that have a '+'. + const isOnboardingGuideAssigned = introSelected?.choice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !session?.email?.includes('+'); + const shouldShowToooltipOnThisReport = isOnboardingGuideAssigned ? ReportUtils.isAdminRoom(report) : ReportUtils.isConciergeChatReport(report); - const {shouldShowProductTrainingTooltip, renderProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext(tooltipToRender, shouldShowTooltip); + const shouldShowGetStartedTooltip = shouldShowToooltipOnThisReport && isScreenFocused; + const {shouldShowProductTrainingTooltip, renderProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext( + CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCEIRGE_LHN_GBR, + shouldShowGetStartedTooltip, + ); const {translate} = useLocalize(); const [isContextMenuActive, setIsContextMenuActive] = useState(false); @@ -158,18 +156,17 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti needsOffscreenAlphaCompositing > diff --git a/src/components/ProductTrainingContext/PRODUCT_TRAINING_TOOLTIP_DATA.ts b/src/components/ProductTrainingContext/PRODUCT_TRAINING_TOOLTIP_DATA.ts new file mode 100644 index 000000000000..d7f2a27d94d2 --- /dev/null +++ b/src/components/ProductTrainingContext/PRODUCT_TRAINING_TOOLTIP_DATA.ts @@ -0,0 +1,67 @@ +import type {ValueOf} from 'type-fest'; +import {dismissProductTraining} from '@libs/actions/Welcome'; +import CONST from '@src/CONST'; +import type {TranslationPaths} from '@src/languages/types'; + +const {CONCEIRGE_LHN_GBR, RENAME_SAVED_SEARCH, WORKSAPCE_CHAT_CREATE, QUICK_ACTION_BUTTON} = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES; + +type ProductTrainingTooltipName = ValueOf; + +type ShouldShowConditionProps = { + shouldUseNarrowLayout?: boolean; +}; + +type TooltipData = { + content: Array<{text: TranslationPaths; isBold: boolean}>; + onHideTooltip: () => void; + name: ProductTrainingTooltipName; + priority: number; + shouldShow: (props: ShouldShowConditionProps) => boolean; +}; + +const PRODUCT_TRAINING_TOOLTIP_DATA: Record = { + [CONCEIRGE_LHN_GBR]: { + content: [ + {text: 'productTrainingTooltip.conciergeLHNGBR.part1', isBold: false}, + {text: 'productTrainingTooltip.conciergeLHNGBR.part2', isBold: true}, + ], + onHideTooltip: () => dismissProductTraining(CONCEIRGE_LHN_GBR), + name: CONCEIRGE_LHN_GBR, + priority: 1300, + shouldShow: ({shouldUseNarrowLayout}) => !!shouldUseNarrowLayout, + }, + [RENAME_SAVED_SEARCH]: { + content: [ + {text: 'productTrainingTooltip.saveSearchTooltip.part1', isBold: true}, + {text: 'productTrainingTooltip.saveSearchTooltip.part2', isBold: false}, + ], + onHideTooltip: () => dismissProductTraining(RENAME_SAVED_SEARCH), + name: RENAME_SAVED_SEARCH, + priority: 1250, + shouldShow: ({shouldUseNarrowLayout}) => !shouldUseNarrowLayout, + }, + [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: 1200, + 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, + }, +}; + +export default PRODUCT_TRAINING_TOOLTIP_DATA; +export type {ProductTrainingTooltipName}; diff --git a/src/components/ProductTrainingContext/TOOLTIPS.ts b/src/components/ProductTrainingContext/TOOLTIPS.ts deleted file mode 100644 index dc2a761a4903..000000000000 --- a/src/components/ProductTrainingContext/TOOLTIPS.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type {ValueOf} from 'type-fest'; -import {dismissProductTraining} from '@libs/actions/Welcome'; -import CONST from '@src/CONST'; -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, -} = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES; - -type ProductTrainingTooltipName = ValueOf; - -type ShouldShowConditionProps = { - shouldUseNarrowLayout?: boolean; -}; - -type TooltipData = { - content: Array<{text: TranslationPaths; isBold: boolean}>; - onHideTooltip: () => void; - name: ProductTrainingTooltipName; - priority: number; - shouldShow: (props: ShouldShowConditionProps) => boolean; -}; - -const TOOLTIPS: Record = { - [CONCEIRGE_LHN_GBR]: { - content: [ - {text: 'productTrainingTooltip.conciergeLHNGBR.part1', isBold: false}, - {text: 'productTrainingTooltip.conciergeLHNGBR.part2', isBold: true}, - ], - onHideTooltip: () => dismissProductTraining(CONCEIRGE_LHN_GBR), - name: CONCEIRGE_LHN_GBR, - priority: 1300, - shouldShow: ({shouldUseNarrowLayout}) => !!shouldUseNarrowLayout, - }, - [RENAME_SAVED_SEARCH]: { - content: [ - {text: 'productTrainingTooltip.saveSearchTooltip.part1', isBold: true}, - {text: 'productTrainingTooltip.saveSearchTooltip.part2', isBold: false}, - ], - onHideTooltip: () => dismissProductTraining(RENAME_SAVED_SEARCH), - name: RENAME_SAVED_SEARCH, - priority: 1250, - shouldShow: ({shouldUseNarrowLayout}) => !shouldUseNarrowLayout, - }, - [GLOBAL_CREATE_TOOLTIP]: { - content: [ - {text: 'productTrainingTooltip.globalCreateTooltip.part1', isBold: true}, - {text: 'productTrainingTooltip.globalCreateTooltip.part2', isBold: false}, - {text: 'productTrainingTooltip.globalCreateTooltip.part3', isBold: false}, - ], - onHideTooltip: () => dismissProductTraining(GLOBAL_CREATE_TOOLTIP), - name: GLOBAL_CREATE_TOOLTIP, - 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: true}, - {text: 'productTrainingTooltip.workspaceChatCreate.part2', 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}, - {text: 'productTrainingTooltip.bottomNavInboxTooltip.part2', isBold: false}, - {text: 'productTrainingTooltip.bottomNavInboxTooltip.part3', isBold: false}, - ], - onHideTooltip: () => dismissProductTraining(BOTTOM_NAV_INBOX_TOOLTIP), - name: BOTTOM_NAV_INBOX_TOOLTIP, - priority: 900, - shouldShow: () => true, - }, - [LHN_WORKSPACE_CHAT_TOOLTIP]: { - content: [ - {text: 'productTrainingTooltip.workspaceChatTooltip.part1', isBold: true}, - {text: 'productTrainingTooltip.workspaceChatTooltip.part2', isBold: false}, - {text: 'productTrainingTooltip.workspaceChatTooltip.part3', isBold: false}, - ], - onHideTooltip: () => dismissProductTraining(LHN_WORKSPACE_CHAT_TOOLTIP), - name: LHN_WORKSPACE_CHAT_TOOLTIP, - priority: 800, - shouldShow: () => true, - }, -}; - -export default TOOLTIPS; -export type {ProductTrainingTooltipName}; diff --git a/src/components/ProductTrainingContext/index.tsx b/src/components/ProductTrainingContext/index.tsx index 7cfcf4d3bfa7..92997fe70af3 100644 --- a/src/components/ProductTrainingContext/index.tsx +++ b/src/components/ProductTrainingContext/index.tsx @@ -9,12 +9,11 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import {hasCompletedGuidedSetupFlowSelector} from '@libs/onboardingSelectors'; -import CONST from '@src/CONST'; +import Permissions from '@libs/Permissions'; import ONYXKEYS from '@src/ONYXKEYS'; import type ChildrenProps from '@src/types/utils/ChildrenProps'; -import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; -import type {ProductTrainingTooltipName} from './TOOLTIPS'; -import TOOLTIPS from './TOOLTIPS'; +import type {ProductTrainingTooltipName} from './PRODUCT_TRAINING_TOOLTIP_DATA'; +import PRODUCT_TRAINING_TOOLTIP_DATA from './PRODUCT_TRAINING_TOOLTIP_DATA'; type ProductTrainingContextType = { shouldRenderTooltip: (tooltipName: ProductTrainingTooltipName) => boolean; @@ -31,10 +30,11 @@ const ProductTrainingContext = createContext({ function ProductTrainingContextProvider({children}: ChildrenProps) { const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRYNEWDOT); const hasBeenAddedToNudgeMigration = !!tryNewDot?.nudgeMigration?.timestamp; - const [isOnboardingCompleted = true, isOnboardingCompletedMetadata] = useOnyx(ONYXKEYS.NVP_ONBOARDING, { + const [isOnboardingCompleted = true] = useOnyx(ONYXKEYS.NVP_ONBOARDING, { selector: hasCompletedGuidedSetupFlowSelector, }); const [dismissedProductTraining] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING); + const [allBetas] = useOnyx(ONYXKEYS.BETAS); const {shouldUseNarrowLayout} = useResponsiveLayout(); const [activeTooltips, setActiveTooltips] = useState>(new Set()); @@ -58,7 +58,7 @@ function ProductTrainingContextProvider({children}: ChildrenProps) { const sortedTooltips = Array.from(activeTooltips) .map((name) => ({ name, - priority: TOOLTIPS[name]?.priority ?? 0, + priority: PRODUCT_TRAINING_TOOLTIP_DATA[name]?.priority ?? 0, })) .sort((a, b) => b.priority - a.priority); @@ -73,22 +73,14 @@ function ProductTrainingContextProvider({children}: ChildrenProps) { const shouldTooltipBeVisible = useCallback( (tooltipName: ProductTrainingTooltipName) => { - if (isLoadingOnyxValue(isOnboardingCompletedMetadata)) { - return false; - } - const isDismissed = !!dismissedProductTraining?.[tooltipName]; - if (isDismissed) { + if (isDismissed || !Permissions.shouldShowProductTrainingElements(allBetas)) { return false; } - const tooltipConfig = TOOLTIPS[tooltipName]; + const tooltipConfig = PRODUCT_TRAINING_TOOLTIP_DATA[tooltipName]; - // if hasBeenAddedToNudgeMigration is true, and welcome modal is not dismissed, don't show tooltip - if (hasBeenAddedToNudgeMigration && !dismissedProductTraining?.[CONST.MIGRATED_USER_WELCOME_MODAL]) { - return false; - } - if (isOnboardingCompleted === false) { + if (!isOnboardingCompleted && !hasBeenAddedToNudgeMigration) { return false; } @@ -96,7 +88,7 @@ function ProductTrainingContextProvider({children}: ChildrenProps) { shouldUseNarrowLayout, }); }, - [dismissedProductTraining, hasBeenAddedToNudgeMigration, isOnboardingCompleted, isOnboardingCompletedMetadata, shouldUseNarrowLayout], + [allBetas, dismissedProductTraining, hasBeenAddedToNudgeMigration, isOnboardingCompleted, shouldUseNarrowLayout], ); const registerTooltip = useCallback( @@ -164,21 +156,21 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou }, [tooltipName, registerTooltip, unregisterTooltip, shouldShow]); const renderProductTrainingTooltip = useCallback(() => { - const tooltip = TOOLTIPS[tooltipName]; + const tooltip = PRODUCT_TRAINING_TOOLTIP_DATA[tooltipName]; return ( - + - + {tooltip.content.map(({text, isBold}) => { const translatedText = translate(text); return ( {translatedText} @@ -191,14 +183,12 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou styles.alignItemsCenter, styles.flexRow, styles.flexWrap, - styles.gap3, + styles.gap1, styles.justifyContentCenter, - styles.mw100, styles.p2, - styles.productTrainingTooltipText, + styles.quickActionTooltipSubtitle, styles.textAlignCenter, styles.textBold, - styles.textWrap, theme.tooltipHighlightText, tooltipName, translate, @@ -209,7 +199,7 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou }, [shouldRenderTooltip, tooltipName]); const hideProductTrainingTooltip = useCallback(() => { - const tooltip = TOOLTIPS[tooltipName]; + const tooltip = PRODUCT_TRAINING_TOOLTIP_DATA[tooltipName]; tooltip.onHideTooltip(); unregisterTooltip(tooltipName); }, [tooltipName, unregisterTooltip]); @@ -217,7 +207,7 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou return { renderProductTrainingTooltip, hideProductTrainingTooltip, - shouldShowProductTrainingTooltip, + shouldShowProductTrainingTooltip: shouldShow && shouldShowProductTrainingTooltip, }; }; diff --git a/src/components/Search/SearchPageHeader.tsx b/src/components/Search/SearchPageHeader.tsx index 21a5832052c0..a78845f126d2 100644 --- a/src/components/Search/SearchPageHeader.tsx +++ b/src/components/Search/SearchPageHeader.tsx @@ -1,4 +1,3 @@ -import {useIsFocused} from '@react-navigation/native'; import React, {useMemo, useState} from 'react'; import {InteractionManager, View} from 'react-native'; import {useOnyx} from 'react-native-onyx'; @@ -9,8 +8,6 @@ import ConfirmModal from '@components/ConfirmModal'; import DecisionModal from '@components/DecisionModal'; import * as Expensicons from '@components/Icon/Expensicons'; import {usePersonalDetails} from '@components/OnyxProvider'; -import {useProductTrainingContext} from '@components/ProductTrainingContext'; -import EducationalTooltip from '@components/Tooltip/EducationalTooltip'; import useActiveWorkspace from '@hooks/useActiveWorkspace'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; @@ -58,11 +55,6 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) { const [isDeleteExpensesConfirmModalVisible, setIsDeleteExpensesConfirmModalVisible] = useState(false); const [isOfflineModalVisible, setIsOfflineModalVisible] = useState(false); const [isDownloadErrorModalVisible, setIsDownloadErrorModalVisible] = useState(false); - const isFocused = useIsFocused(); - const {renderProductTrainingTooltip, shouldShowProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext( - CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SEARCH_FILTER_BUTTON_TOOLTIP, - isFocused, - ); const {status, hash} = queryJSON; @@ -356,25 +348,12 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) { shouldUseStyleUtilityForAnchorPosition /> ) : ( - -