@@ -3,7 +3,6 @@ import {hasCompletedGuidedSetupFlowSelector} from '@selectors/Onboarding';
33import { emailSelector } from '@selectors/Session' ;
44import React , { createContext , useCallback , useContext , useEffect , useMemo , useState } from 'react' ;
55import { View } from 'react-native' ;
6- import Button from '@components/Button' ;
76import Icon from '@components/Icon' ;
87import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback' ;
98import RenderHTML from '@components/RenderHTML' ;
@@ -31,16 +30,6 @@ type ProductTrainingContextType = {
3130} ;
3231
3332type ProductTrainingContextConfig = {
34- /**
35- * Callback to be called when the tooltip is dismissed
36- */
37- onDismiss ?: ( ) => void ;
38-
39- /**
40- * Callback to be called when the tooltip is confirmed
41- */
42- onConfirm ?: ( ) => void ;
43-
4433 /**
4534 * Callback to be called when the tooltip is shown
4635 */
@@ -151,9 +140,6 @@ function ProductTrainingContextProvider({children}: ChildrenProps) {
151140
152141 // 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
153142 if (
154- tooltipName !== CONST . PRODUCT_TRAINING_TOOLTIP_NAMES . SCAN_TEST_TOOLTIP &&
155- tooltipName !== CONST . PRODUCT_TRAINING_TOOLTIP_NAMES . SCAN_TEST_TOOLTIP_MANAGER &&
156- tooltipName !== CONST . PRODUCT_TRAINING_TOOLTIP_NAMES . SCAN_TEST_CONFIRMATION &&
157143 tooltipName !== CONST . PRODUCT_TRAINING_TOOLTIP_NAMES . SCAN_TEST_DRIVE_CONFIRMATION &&
158144 tooltipName !== CONST . PRODUCT_TRAINING_TOOLTIP_NAMES . GPS_TOOLTIP &&
159145 tooltipName !== CONST . PRODUCT_TRAINING_TOOLTIP_NAMES . HAS_FILTER_NEGATION &&
@@ -278,17 +264,7 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou
278264 fsClass = { CONST . FULLSTORY . CLASS . UNMASK }
279265 onLayout = { config . onShown }
280266 >
281- < View
282- style = { [
283- styles . alignItemsCenter ,
284- styles . flexRow ,
285- tooltip ?. shouldRenderActionButtons ? styles . justifyContentStart : styles . justifyContentCenter ,
286- styles . textAlignCenter ,
287- styles . gap3 ,
288- styles . pv2 ,
289- styles . ph2 ,
290- ] }
291- >
267+ < View style = { [ styles . alignItemsCenter , styles . flexRow , styles . justifyContentCenter , styles . textAlignCenter , styles . gap3 , styles . pv2 , styles . ph2 ] } >
292268 < Icon
293269 src = { expensifyIcons . Lightbulb }
294270 fill = { theme . tooltipHighlightText }
@@ -297,62 +273,39 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou
297273 < View style = { [ styles . renderHTML , styles . dFlex , styles . flexShrink1 ] } >
298274 < RenderHTML html = { translate ( tooltip . content ) } />
299275 </ View >
300- { ! tooltip ?. shouldRenderActionButtons && (
301- < PressableWithoutFeedback
302- sentryLabel = { CONST . SENTRY_LABEL . PRODUCT_TRAINING . TOOLTIP }
303- shouldUseAutoHitSlop
304- accessibilityLabel = { translate ( 'common.noThanks' ) }
305- role = { CONST . ROLE . BUTTON }
306- onPress = { ( ) => hideTooltip ( true ) }
307- >
308- < Icon
309- src = { expensifyIcons . Close }
310- fill = { theme . icon }
311- width = { variables . iconSizeSemiSmall }
312- height = { variables . iconSizeSemiSmall }
313- />
314- </ PressableWithoutFeedback >
315- ) }
316- </ View >
317- { ! ! tooltip ?. shouldRenderActionButtons && (
318- < View style = { [ styles . alignItemsCenter , styles . justifyContentBetween , styles . flexRow , styles . ph2 , styles . pv2 , styles . gap2 ] } >
319- < Button
320- success
321- text = { translate ( 'productTrainingTooltip.scanTestTooltip.tryItOut' ) }
322- style = { [ styles . flex1 ] }
323- onPress = { config . onConfirm }
324- />
325- < Button
326- text = { translate ( 'common.noThanks' ) }
327- style = { [ styles . flex1 ] }
328- onPress = { config . onDismiss }
276+ < PressableWithoutFeedback
277+ sentryLabel = { CONST . SENTRY_LABEL . PRODUCT_TRAINING . TOOLTIP }
278+ shouldUseAutoHitSlop
279+ accessibilityLabel = { translate ( 'common.noThanks' ) }
280+ role = { CONST . ROLE . BUTTON }
281+ onPress = { ( ) => hideTooltip ( true ) }
282+ >
283+ < Icon
284+ src = { expensifyIcons . Close }
285+ fill = { theme . icon }
286+ width = { variables . iconSizeSemiSmall }
287+ height = { variables . iconSizeSemiSmall }
329288 />
330- </ View >
331- ) }
289+ </ PressableWithoutFeedback >
290+ </ View >
332291 </ View >
333292 ) ;
334293 } , [
335294 tooltipName ,
336295 styles . alignItemsCenter ,
337296 styles . flexRow ,
338- styles . justifyContentStart ,
339297 styles . justifyContentCenter ,
340298 styles . textAlignCenter ,
341299 styles . gap3 ,
342300 styles . pv2 ,
343- styles . flex1 ,
344- styles . justifyContentBetween ,
345301 styles . ph2 ,
346- styles . gap2 ,
347302 styles . renderHTML ,
348303 styles . dFlex ,
349304 styles . flexShrink1 ,
350305 theme . tooltipHighlightText ,
351306 theme . icon ,
352307 translate ,
353308 config . onShown ,
354- config . onConfirm ,
355- config . onDismiss ,
356309 hideTooltip ,
357310 expensifyIcons . Close ,
358311 expensifyIcons . Lightbulb ,
0 commit comments