@@ -9,7 +9,6 @@ import Avatar from '@components/Avatar';
99import Badge from '@components/Badge' ;
1010import Icon from '@components/Icon' ;
1111import type { PopoverMenuItem } from '@components/PopoverMenu' ;
12- import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback' ;
1312import Text from '@components/Text' ;
1413import TextWithTooltip from '@components/TextWithTooltip' ;
1514import ThreeDotsMenu from '@components/ThreeDotsMenu' ;
@@ -85,12 +84,6 @@ type WorkspacesListRowProps = WithCurrentUserPersonalDetailsProps & {
8584
8685 /** Whether the list item is hovered */
8786 isHovered ?: boolean ;
88-
89- /** Whether the row press is disabled */
90- disabled ?: boolean ;
91-
92- /** Callback when the row is pressed */
93- onPress ?: ( ) => void ;
9487} ;
9588
9689type BrickRoadIndicatorIconProps = {
@@ -129,8 +122,6 @@ function WorkspacesListRow({
129122 isLoadingBill,
130123 resetLoadingSpinnerIconIndex,
131124 isHovered,
132- disabled,
133- onPress,
134125} : WorkspacesListRowProps ) {
135126 const styles = useThemeStyles ( ) ;
136127 const { translate} = useLocalize ( ) ;
@@ -186,92 +177,58 @@ function WorkspacesListRow({
186177
187178 const isDeleted = style && Array . isArray ( style ) ? style . includes ( styles . offlineFeedbackDeleted ) : false ;
188179
189- const ownerName = ownerDetails ? getDisplayNameOrDefault ( ownerDetails ) : '' ;
190- const workspaceTypeName = workspaceType ? getUserFriendlyWorkspaceType ( workspaceType , translate ) : '' ;
191- const accessibilityLabel = [
192- `${ translate ( 'workspace.common.workspaceName' ) } : ${ title } ` ,
193- isDefault ? translate ( 'common.default' ) : '' ,
194- isJoinRequestPending ? translate ( 'workspace.common.requested' ) : '' ,
195- ownerName ? `${ translate ( 'workspace.common.workspaceOwner' ) } : ${ ownerName } ` : '' ,
196- workspaceTypeName ? `${ translate ( 'workspace.common.workspaceType' ) } : ${ workspaceTypeName } ` : '' ,
197- ]
198- . filter ( Boolean )
199- . join ( ', ' ) ;
200-
201- const RequestedBadge = isJoinRequestPending ? (
202- < View style = { [ styles . flexRow , styles . gap2 , styles . alignItemsCenter , styles . justifyContentEnd ] } >
203- < Badge
204- text = { translate ( 'workspace.common.requested' ) }
205- textStyles = { styles . textStrong }
206- badgeStyles = { [ styles . alignSelfCenter , styles . badgeBordered ] }
207- icon = { icons . Hourglass }
208- />
209- </ View >
210- ) : null ;
211-
212- const DefaultBadge = isDefault ? (
213- < Tooltip
214- maxWidth = { variables . w184 }
215- text = { translate ( 'workspace.common.defaultNote' ) }
216- numberOfLines = { 4 }
217- >
218- < View style = { [ styles . flexRow , styles . gap2 , styles . alignItemsCenter , styles . justifyContentEnd ] } >
219- < Badge
220- text = { translate ( 'common.default' ) }
221- textStyles = { styles . textStrong }
222- badgeStyles = { [ styles . alignSelfCenter , styles . badgeBordered , styles . badgeSuccess ] }
223- />
224- </ View >
225- </ Tooltip >
226- ) : null ;
227-
228- const ThreeDotsSection = ! isJoinRequestPending ? (
229- < View style = { [ styles . flexRow , styles . gap1 , ! isNarrow && styles . ml2 , isNarrow && styles . alignItemsCenter ] } >
230- < View style = { [ styles . flexRow , styles . gap2 , styles . alignItemsCenter , isNarrow && styles . workspaceListRBR ] } >
231- < BrickRoadIndicatorIcon brickRoadIndicator = { brickRoadIndicator } />
232- </ View >
233- < ThreeDotsMenu
234- isContainerFocused = { isFocused }
235- shouldSelfPosition
236- menuItems = { menuItems }
237- anchorAlignment = { { horizontal : CONST . MODAL . ANCHOR_ORIGIN_HORIZONTAL . RIGHT , vertical : CONST . MODAL . ANCHOR_ORIGIN_VERTICAL . TOP } }
238- shouldOverlay
239- disabled = { shouldDisableThreeDotsMenu }
240- isNested
241- threeDotsMenuRef = { threeDotsMenuRef }
242- sentryLabel = { CONST . SENTRY_LABEL . WORKSPACE . LIST . THREE_DOT_MENU }
243- />
244- </ View >
245- ) : null ;
246-
247- const NarrowBadges =
248- isJoinRequestPending || isDefault ? (
249- < View style = { [ styles . flexRow , styles . gap1 , styles . alignItemsCenter ] } >
250- { RequestedBadge }
251- { DefaultBadge }
252- </ View >
253- ) : null ;
254-
255180 const ThreeDotMenuOrPendingIcon = (
256181 < View style = { [ styles . flexRow , ! shouldUseNarrowLayout && styles . workspaceThreeDotMenu ] } >
257- { RequestedBadge }
258- { DefaultBadge }
259- { ThreeDotsSection }
182+ { ! ! isJoinRequestPending && (
183+ < View style = { [ styles . flexRow , styles . gap2 , styles . alignItemsCenter , styles . justifyContentEnd ] } >
184+ < Badge
185+ text = { translate ( 'workspace.common.requested' ) }
186+ textStyles = { styles . textStrong }
187+ badgeStyles = { [ styles . alignSelfCenter , styles . badgeBordered ] }
188+ icon = { icons . Hourglass }
189+ />
190+ </ View >
191+ ) }
192+ { ! ! isDefault && (
193+ < Tooltip
194+ maxWidth = { variables . w184 }
195+ text = { translate ( 'workspace.common.defaultNote' ) }
196+ numberOfLines = { 4 }
197+ >
198+ < View style = { [ styles . flexRow , styles . gap2 , styles . alignItemsCenter , styles . justifyContentEnd ] } >
199+ < Badge
200+ text = { translate ( 'common.default' ) }
201+ textStyles = { styles . textStrong }
202+ badgeStyles = { [ styles . alignSelfCenter , styles . badgeBordered , styles . badgeSuccess ] }
203+ />
204+ </ View >
205+ </ Tooltip >
206+ ) }
207+ { ! isJoinRequestPending && (
208+ < View style = { [ styles . flexRow , styles . ml2 , styles . gap1 ] } >
209+ < View style = { [ styles . flexRow , styles . gap2 , styles . alignItemsCenter , isNarrow && styles . workspaceListRBR ] } >
210+ < BrickRoadIndicatorIcon brickRoadIndicator = { brickRoadIndicator } />
211+ </ View >
212+ < ThreeDotsMenu
213+ isContainerFocused = { isFocused }
214+ shouldSelfPosition
215+ menuItems = { menuItems }
216+ anchorAlignment = { { horizontal : CONST . MODAL . ANCHOR_ORIGIN_HORIZONTAL . RIGHT , vertical : CONST . MODAL . ANCHOR_ORIGIN_VERTICAL . TOP } }
217+ shouldOverlay
218+ disabled = { shouldDisableThreeDotsMenu }
219+ isNested
220+ threeDotsMenuRef = { threeDotsMenuRef }
221+ sentryLabel = { CONST . SENTRY_LABEL . WORKSPACE . LIST . THREE_DOT_MENU }
222+ />
223+ </ View >
224+ ) }
260225 </ View >
261226 ) ;
262227
263228 return (
264229 < View style = { [ styles . flexRow , styles . highlightBG , rowStyles , style , styles . br3 ] } >
265230 < Animated . View style = { [ styles . flex1 , styles . flexRow , styles . bgTransparent , isWide && styles . gap5 , styles . p5 , styles . pr3 , animatedHighlightStyle ] } >
266- < PressableWithoutFeedback
267- accessible
268- accessibilityLabel = { accessibilityLabel }
269- role = { isWide ? CONST . ROLE . ROW : CONST . ROLE . BUTTON }
270- onPress = { onPress }
271- disabled = { disabled }
272- style = { [ isWide ? styles . flexRow : styles . flexColumn , styles . flex1 , isWide && styles . gap5 ] }
273- sentryLabel = { CONST . SENTRY_LABEL . WORKSPACE . LIST . ROW }
274- >
231+ < View style = { [ isWide ? styles . flexRow : styles . flexColumn , styles . flex1 , isWide && styles . gap5 ] } >
275232 < View
276233 role = { isWide ? CONST . ROLE . CELL : undefined }
277234 style = { [ styles . flexRow , styles . justifyContentBetween , styles . flex2 , isNarrow && styles . mb3 , styles . alignItemsCenter ] }
@@ -292,7 +249,7 @@ function WorkspacesListRow({
292249 style = { [ styles . flex1 , styles . flexGrow1 , styles . textStrong , isDeleted ? styles . offlineFeedbackDeleted : { } ] }
293250 />
294251 </ View >
295- { isNarrow && NarrowBadges }
252+ { isNarrow && ThreeDotMenuOrPendingIcon }
296253 </ View >
297254 < View
298255 role = { isWide ? CONST . ROLE . CELL : undefined }
@@ -349,30 +306,23 @@ function WorkspacesListRow({
349306 </ Text >
350307 </ View >
351308 </ View >
352- </ PressableWithoutFeedback >
309+ </ View >
353310
354311 < View
355312 role = { isWide ? CONST . ROLE . CELL : undefined }
356- style = { [ styles . flexRow , styles . alignItemsCenter , isNarrow && styles . alignSelfStart ] }
313+ style = { [ styles . flexRow , styles . alignItemsCenter ] }
357314 >
358- { isNarrow && ThreeDotsSection }
359315 { ! isNarrow && ThreeDotMenuOrPendingIcon }
360316 { ! isNarrow && (
361- < PressableWithoutFeedback
362- onPress = { onPress }
363- disabled = { disabled }
364- accessible = { false }
365- sentryLabel = { CONST . SENTRY_LABEL . WORKSPACE . LIST . ROW_ARROW }
366- style = { [ styles . justifyContentCenter , styles . alignItemsCenter , styles . touchableButtonImage ] }
367- >
317+ < View style = { [ styles . justifyContentCenter , styles . alignItemsCenter , styles . touchableButtonImage ] } >
368318 < Icon
369319 src = { icons . ArrowRight }
370320 fill = { theme . icon }
371321 additionalStyles = { [ styles . alignSelfCenter , ! isHovered && styles . opacitySemiTransparent ] }
372322 isButtonIcon
373323 medium
374324 />
375- </ PressableWithoutFeedback >
325+ </ View >
376326 ) }
377327 </ View >
378328 </ Animated . View >
0 commit comments