1- import React , { useMemo } from 'react' ;
1+ import React from 'react' ;
22import type { OnyxEntry } from 'react-native-onyx' ;
33import { useLHNTooltipContext } from '@components/LHNOptionsList/LHNTooltipContext' ;
44import OfflineWithFeedback from '@components/OfflineWithFeedback' ;
55import { useSession } from '@components/OnyxListItemProvider' ;
6- import { useProductTrainingContext } from '@components/ProductTrainingContext' ;
76import EducationalTooltip from '@components/Tooltip/EducationalTooltip' ;
87import useOnyx from '@hooks/useOnyx' ;
9- import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
108import useThemeStyles from '@hooks/useThemeStyles' ;
119import { isAdminRoom , isChatUsedForOnboarding as isChatUsedForOnboardingReportUtils , isConciergeChatReport } from '@libs/ReportUtils' ;
1210import type { OptionData } from '@libs/ReportUtils' ;
1311import variables from '@styles/variables' ;
1412import CONST from '@src/CONST' ;
1513import ONYXKEYS from '@src/ONYXKEYS' ;
1614import type { Report } from '@src/types/onyx' ;
15+ import useLHNRowProductTrainingTooltip from './useLHNRowProductTrainingTooltip' ;
1716
1817type OptionRowTooltipLayerProps = {
1918 /** Report ID of the row */
@@ -25,32 +24,17 @@ type OptionRowTooltipLayerProps = {
2524 /** Option data, used to forward pendingAction and errors to OfflineWithFeedback */
2625 optionItem : OptionData ;
2726
28- /** Renders the row content. Receives an optional `onPressBefore` callback (tooltip hide) to compose with row press. */
29- renderChildren : ( onPressBefore ?: ( ) => void ) => React . ReactNode ;
27+ /** Renders the row content. */
28+ renderChildren : ( ) => React . ReactNode ;
3029} ;
3130
3231type OptionRowTooltipLayerInnerProps = {
33- renderChildren : ( onPressBefore ?: ( ) => void ) => React . ReactNode ;
32+ renderChildren : ( ) => React . ReactNode ;
3433} ;
3534
3635function OptionRowTooltipLayerInner ( { renderChildren} : OptionRowTooltipLayerInnerProps ) {
3736 const styles = useThemeStyles ( ) ;
38- const { shouldUseNarrowLayout} = useResponsiveLayout ( ) ;
39- const { isFullscreenVisible, isScreenFocused, isReportsSplitNavigatorLast} = useLHNTooltipContext ( ) ;
40-
41- const { tooltipToRender, shouldShowTooltip} = useMemo ( ( ) => {
42- // TODO: CONCIERGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room
43- // https://github.com/Expensify/App/issues/57045#issuecomment-2701455668
44- const tooltip = CONST . PRODUCT_TRAINING_TOOLTIP_NAMES . CONCIERGE_LHN_GBR ;
45- const shouldTooltipBeVisible = shouldUseNarrowLayout ? isScreenFocused && isReportsSplitNavigatorLast : isReportsSplitNavigatorLast && ! isFullscreenVisible ;
46-
47- return {
48- tooltipToRender : tooltip ,
49- shouldShowTooltip : shouldTooltipBeVisible ,
50- } ;
51- } , [ isScreenFocused , shouldUseNarrowLayout , isReportsSplitNavigatorLast , isFullscreenVisible ] ) ;
52-
53- const { shouldShowProductTrainingTooltip, renderProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext ( tooltipToRender , shouldShowTooltip ) ;
37+ const { shouldShowProductTrainingTooltip, renderProductTrainingTooltip, hideProductTrainingTooltip} = useLHNRowProductTrainingTooltip ( ) ;
5438
5539 return (
5640 < EducationalTooltip
@@ -66,7 +50,7 @@ function OptionRowTooltipLayerInner({renderChildren}: OptionRowTooltipLayerInner
6650 onTooltipPress = { hideProductTrainingTooltip }
6751 shouldHideOnScroll
6852 >
69- { renderChildren ( hideProductTrainingTooltip ) }
53+ { renderChildren ( ) }
7054 </ EducationalTooltip >
7155 ) ;
7256}
0 commit comments