@@ -16,14 +16,15 @@ import DescriptiveText from './OptionRow/DescriptiveText';
1616import DraftIndicator from './OptionRow/DraftIndicator' ;
1717import ErrorBadge from './OptionRow/ErrorBadge' ;
1818import InfoBadge from './OptionRow/InfoBadge' ;
19+ import OfflineWrapper from './OptionRow/OfflineWrapper' ;
1920import OnboardingBadge from './OptionRow/OnboardingBadge' ;
2021import PinIndicator from './OptionRow/PinIndicator' ;
22+ import ProductTrainingTooltip from './OptionRow/ProductTrainingTooltip' ;
2123import Status from './OptionRow/Status' ;
2224import Subtitle from './OptionRow/Subtitle' ;
2325import Title from './OptionRow/Title' ;
2426import OptionRowAvatar from './OptionRowAvatar' ;
2527import OptionRowPressable from './OptionRowPressable' ;
26- import OptionRowTooltipLayer from './OptionRowTooltipLayer' ;
2728
2829function OptionRowLHN ( { isOptionFocused = false , onSelectRow = ( ) => { } , optionItem, viewMode = 'default' , style, onLayout = ( ) => { } , hasDraftComment, testID} : OptionRowLHNProps ) {
2930 const { isProduction} = useEnvironment ( ) ;
@@ -77,86 +78,86 @@ function OptionRowLHN({isOptionFocused = false, onSelectRow = () => {}, optionIt
7778 contextMenuHint,
7879 } ) ;
7980
80- const renderPressableRow = ( ) => (
81- < OptionRowPressable
82- optionItem = { optionItem }
83- isOptionFocused = { isOptionFocused }
84- isScreenFocused = { isScreenFocused }
85- popoverAnchor = { popoverAnchor }
86- onSelectRow = { onSelectRow }
87- onLayout = { onLayout }
88- accessibilityLabel = { accessibilityLabelWithContextMenuHint }
89- accessibilityHint = { accessibilityHint }
90- // reportID may be a number contrary to the type definition
91- testID = { typeof optionItem . reportID === 'number' ? String ( optionItem . reportID ) : optionItem . reportID }
81+ return (
82+ < OfflineWrapper
83+ pendingAction = { optionItem . pendingAction }
84+ errors = { optionItem . allReportErrors }
9285 >
93- { ( hovered ) => {
94- let secondaryAvatarBgColor = theme . sidebar ;
95- if ( isOptionFocused ) {
96- secondaryAvatarBgColor = focusedBackgroundColor ;
97- } else if ( hovered ) {
98- secondaryAvatarBgColor = hoveredBackgroundColor ;
99- }
100- return (
101- < >
102- < View style = { sidebarInnerRowStyle } >
103- < View style = { [ styles . flexRow , styles . alignItemsCenter ] } >
104- < OptionRowAvatar
105- optionItem = { optionItem }
106- isInFocusMode = { isInFocusMode }
107- subscriptAvatarBorderColor = { hovered && ! isOptionFocused ? hoveredBackgroundColor : subscriptAvatarBorderColor }
108- secondaryAvatarBackgroundColor = { secondaryAvatarBgColor }
109- singleAvatarContainerStyle = { singleAvatarContainerStyle }
110- />
111- < View style = { contentContainerStyles } >
112- < View style = { [ styles . flexRow , styles . alignItemsCenter , styles . mw100 , styles . overflowHidden ] } >
113- < Title
86+ < ProductTrainingTooltip optionItem = { optionItem } >
87+ < OptionRowPressable
88+ optionItem = { optionItem }
89+ isOptionFocused = { isOptionFocused }
90+ isScreenFocused = { isScreenFocused }
91+ popoverAnchor = { popoverAnchor }
92+ onSelectRow = { onSelectRow }
93+ onLayout = { onLayout }
94+ accessibilityLabel = { accessibilityLabelWithContextMenuHint }
95+ accessibilityHint = { accessibilityHint }
96+ // reportID may be a number contrary to the type definition
97+ testID = { typeof optionItem . reportID === 'number' ? String ( optionItem . reportID ) : optionItem . reportID }
98+ >
99+ { ( hovered ) => {
100+ let secondaryAvatarBgColor = theme . sidebar ;
101+ if ( isOptionFocused ) {
102+ secondaryAvatarBgColor = focusedBackgroundColor ;
103+ } else if ( hovered ) {
104+ secondaryAvatarBgColor = hoveredBackgroundColor ;
105+ }
106+ return (
107+ < >
108+ < View style = { sidebarInnerRowStyle } >
109+ < View style = { [ styles . flexRow , styles . alignItemsCenter ] } >
110+ < OptionRowAvatar
114111 optionItem = { optionItem }
115- displayNameStyle = { displayNameStyle }
116- testID = { testID }
112+ isInFocusMode = { isInFocusMode }
113+ subscriptAvatarBorderColor = { hovered && ! isOptionFocused ? hoveredBackgroundColor : subscriptAvatarBorderColor }
114+ secondaryAvatarBackgroundColor = { secondaryAvatarBgColor }
115+ singleAvatarContainerStyle = { singleAvatarContainerStyle }
116+ />
117+ < View style = { contentContainerStyles } >
118+ < View style = { [ styles . flexRow , styles . alignItemsCenter , styles . mw100 , styles . overflowHidden ] } >
119+ < Title
120+ optionItem = { optionItem }
121+ displayNameStyle = { displayNameStyle }
122+ testID = { testID }
123+ />
124+ < OnboardingBadge optionItem = { optionItem } />
125+ < Status optionItem = { optionItem } />
126+ </ View >
127+ < Subtitle
128+ optionItem = { optionItem }
129+ viewMode = { viewMode }
130+ isOptionFocused = { isOptionFocused }
131+ style = { style }
132+ />
133+ </ View >
134+ < DescriptiveText optionItem = { optionItem } />
135+ < ErrorBadge
136+ brickRoadIndicator = { brickRoadIndicator }
137+ actionBadge = { optionItem . actionBadge }
117138 />
118- < OnboardingBadge optionItem = { optionItem } />
119- < Status optionItem = { optionItem } />
120139 </ View >
121- < Subtitle
122- optionItem = { optionItem }
123- viewMode = { viewMode }
124- isOptionFocused = { isOptionFocused }
125- style = { style }
140+ </ View >
141+ < View style = { [ styles . flexRow , styles . alignItemsCenter ] } >
142+ < InfoBadge
143+ brickRoadIndicator = { brickRoadIndicator }
144+ actionBadge = { optionItem . actionBadge }
145+ />
146+ < DraftIndicator
147+ hasDraftComment = { hasDraftComment }
148+ isAllowedToComment = { optionItem . isAllowedToComment }
149+ />
150+ < PinIndicator
151+ isPinned = { optionItem . isPinned }
152+ brickRoadIndicator = { brickRoadIndicator }
126153 />
127154 </ View >
128- < DescriptiveText optionItem = { optionItem } />
129- < ErrorBadge
130- brickRoadIndicator = { brickRoadIndicator }
131- actionBadge = { optionItem . actionBadge }
132- />
133- </ View >
134- </ View >
135- < View style = { [ styles . flexRow , styles . alignItemsCenter ] } >
136- < InfoBadge
137- brickRoadIndicator = { brickRoadIndicator }
138- actionBadge = { optionItem . actionBadge }
139- />
140- < DraftIndicator
141- hasDraftComment = { hasDraftComment }
142- isAllowedToComment = { optionItem . isAllowedToComment }
143- />
144- < PinIndicator
145- isPinned = { optionItem . isPinned }
146- brickRoadIndicator = { brickRoadIndicator }
147- />
148- </ View >
149- </ >
150- ) ;
151- } }
152- </ OptionRowPressable >
153- ) ;
154-
155- return (
156- < OptionRowTooltipLayer
157- optionItem = { optionItem }
158- renderChildren = { renderPressableRow }
159- />
155+ </ >
156+ ) ;
157+ } }
158+ </ OptionRowPressable >
159+ </ ProductTrainingTooltip >
160+ </ OfflineWrapper >
160161 ) ;
161162}
162163
0 commit comments