@@ -70,6 +70,7 @@ function ReportActionAvatarSingle({
7070 accountID,
7171 fallbackIcon,
7272 isInReportAction,
73+ fallbackUsername,
7374} : {
7475 avatar : IconType | undefined ;
7576 size : ValueOf < typeof CONST . AVATAR_SIZE > ;
@@ -79,6 +80,7 @@ function ReportActionAvatarSingle({
7980 delegateAccountID ?: number ;
8081 fallbackIcon ?: AvatarSource ;
8182 isInReportAction ?: boolean ;
83+ fallbackUsername ?: string ;
8284} ) {
8385 const StyleUtils = useStyleUtils ( ) ;
8486 const avatarContainerStyles = StyleUtils . getContainerStyles ( size , isInReportAction ) ;
@@ -89,7 +91,8 @@ function ReportActionAvatarSingle({
8991 delegateAccountID = { delegateAccountID }
9092 icon = { avatar }
9193 fallbackUserDetails = { {
92- displayName : avatar ?. name ,
94+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
95+ displayName : fallbackUsername || avatar ?. name ,
9396 } }
9497 shouldRender = { shouldShowTooltip }
9598 >
@@ -118,6 +121,7 @@ function ReportActionAvatarSubscript({
118121 noRightMarginOnContainer,
119122 subscriptAvatarBorderColor,
120123 subscriptCardFeed,
124+ fallbackUsername,
121125} : {
122126 primaryAvatar : IconType ;
123127 secondaryAvatar : IconType ;
@@ -126,6 +130,7 @@ function ReportActionAvatarSubscript({
126130 noRightMarginOnContainer ?: boolean ;
127131 subscriptAvatarBorderColor ?: ColorValue ;
128132 subscriptCardFeed ?: CompanyCardFeed | typeof CONST . EXPENSIFY_CARD . BANK ;
133+ fallbackUsername ?: string ;
129134} ) {
130135 const theme = useTheme ( ) ;
131136 const styles = useThemeStyles ( ) ;
@@ -163,7 +168,8 @@ function ReportActionAvatarSubscript({
163168 accountID = { Number ( primaryAvatar . id ?? CONST . DEFAULT_NUMBER_ID ) }
164169 icon = { primaryAvatar }
165170 fallbackUserDetails = { {
166- displayName : primaryAvatar . name ,
171+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
172+ displayName : fallbackUsername || primaryAvatar . name ,
167173 } }
168174 >
169175 < View >
@@ -266,11 +272,13 @@ function ReportActionAvatarMultipleHorizontal({
266272 icons : unsortedIcons ,
267273 isInReportAction,
268274 sort : sortAvatars ,
275+ fallbackUsername,
269276} : HorizontalStacking & {
270277 size : ValueOf < typeof CONST . AVATAR_SIZE > ;
271278 shouldShowTooltip : boolean ;
272279 icons : IconType [ ] ;
273280 isInReportAction : boolean ;
281+ fallbackUsername ?: string ;
274282} ) {
275283 const theme = useTheme ( ) ;
276284 const styles = useThemeStyles ( ) ;
@@ -330,7 +338,8 @@ function ReportActionAvatarMultipleHorizontal({
330338 accountID = { Number ( icon . id ) }
331339 icon = { icon }
332340 fallbackUserDetails = { {
333- displayName : icon . name ,
341+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
342+ displayName : fallbackUsername || icon . name ,
334343 } }
335344 shouldRender = { shouldShowTooltip }
336345 >
@@ -404,6 +413,7 @@ function ReportActionAvatarMultipleDiagonal({
404413 useMidSubscriptSize,
405414 secondaryAvatarContainerStyle,
406415 isHovered = false ,
416+ fallbackUsername,
407417} : {
408418 size : ValueOf < typeof CONST . AVATAR_SIZE > ;
409419 shouldShowTooltip : boolean ;
@@ -412,6 +422,7 @@ function ReportActionAvatarMultipleDiagonal({
412422 useMidSubscriptSize : boolean ;
413423 secondaryAvatarContainerStyle ?: StyleProp < ViewStyle > ;
414424 isHovered ?: boolean ;
425+ fallbackUsername ?: string ;
415426} ) {
416427 const theme = useTheme ( ) ;
417428 const styles = useThemeStyles ( ) ;
@@ -472,7 +483,8 @@ function ReportActionAvatarMultipleDiagonal({
472483 accountID = { Number ( icons . at ( 0 ) ?. id ) }
473484 icon = { icons . at ( 0 ) }
474485 fallbackUserDetails = { {
475- displayName : icons . at ( 0 ) ?. name ,
486+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
487+ displayName : fallbackUsername || icons . at ( 0 ) ?. name ,
476488 } }
477489 shouldRender = { shouldShowTooltip }
478490 >
@@ -502,7 +514,8 @@ function ReportActionAvatarMultipleDiagonal({
502514 accountID = { Number ( icons . at ( 1 ) ?. id ) }
503515 icon = { icons . at ( 1 ) }
504516 fallbackUserDetails = { {
505- displayName : icons . at ( 1 ) ?. name ,
517+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
518+ displayName : fallbackUsername || icons . at ( 1 ) ?. name ,
506519 } }
507520 shouldRender = { shouldShowTooltip }
508521 >
0 commit comments