@@ -15,30 +15,6 @@ import {showContextMenu} from '@pages/inbox/report/ContextMenu/ReportActionConte
1515import variables from '@styles/variables' ;
1616import CONST from '@src/CONST' ;
1717
18- type OptionRowLHNCorePressHandler = ( event : GestureResponderEvent | KeyboardEvent | undefined ) => void ;
19-
20- type UseOptionRowLHNCorePressParams = {
21- reportID : string ;
22- optionItem : OptionData ;
23- popoverAnchor : RefObject < View | null > ;
24- onSelectRow : ( optionItem : OptionData , popoverAnchor : RefObject < View | null > ) => void ;
25- } ;
26-
27- /** LHN row press: telemetry span, composer focus, then onSelectRow. Lives next to OptionRowPressable per review. */
28- function useOptionRowLHNCorePress ( { reportID, optionItem, popoverAnchor, onSelectRow} : UseOptionRowLHNCorePressParams ) : OptionRowLHNCorePressHandler {
29- return ( event : GestureResponderEvent | KeyboardEvent | undefined ) => {
30- startSpan ( `${ CONST . TELEMETRY . SPAN_OPEN_REPORT } _${ reportID } ` , {
31- name : 'OptionRowLHN' ,
32- op : CONST . TELEMETRY . SPAN_OPEN_REPORT ,
33- } ) ;
34-
35- event ?. preventDefault ( ) ;
36- // Enable Composer to focus on clicking the same chat after opening the context menu.
37- ReportActionComposeFocusManager . focus ( ) ;
38- onSelectRow ( optionItem , popoverAnchor ) ;
39- } ;
40- }
41-
4218type OptionRowPressableProps = {
4319 reportID : string ;
4420 optionItem : OptionData ;
@@ -69,10 +45,17 @@ function OptionRowPressable({
6945 testID,
7046 children,
7147} : OptionRowPressableProps ) {
72- const corePress = useOptionRowLHNCorePress ( { reportID, optionItem, popoverAnchor, onSelectRow} ) ;
7348 const onPress = ( event : GestureResponderEvent | KeyboardEvent | undefined ) => {
7449 onPressBefore ?.( ) ;
75- corePress ( event ) ;
50+ startSpan ( `${ CONST . TELEMETRY . SPAN_OPEN_REPORT } _${ reportID } ` , {
51+ name : 'OptionRowLHN' ,
52+ op : CONST . TELEMETRY . SPAN_OPEN_REPORT ,
53+ } ) ;
54+
55+ event ?. preventDefault ( ) ;
56+ // Enable Composer to focus on clicking the same chat after opening the context menu.
57+ ReportActionComposeFocusManager . focus ( ) ;
58+ onSelectRow ( optionItem , popoverAnchor ) ;
7659 } ;
7760 const theme = useTheme ( ) ;
7861 const styles = useThemeStyles ( ) ;
0 commit comments