-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Fallback Avatar to Support Themes #38674
Changes from 9 commits
05dba39
5fd775b
6c85462
04d24d2
840297c
7ba8e43
07b15ec
6ab91c0
228653d
4dc1be2
44dc9fc
988ee9a
419ac90
72e9d75
8e563fa
68d374f
3679762
0d8079e
7b035de
7c7229f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -7,6 +7,7 @@ import lodashSet from 'lodash/set'; | |||
import lodashSortBy from 'lodash/sortBy'; | ||||
import Onyx from 'react-native-onyx'; | ||||
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; | ||||
import {FallbackAvatar} from '@components/Icon/Expensicons'; | ||||
import CONST from '@src/CONST'; | ||||
import type {TranslationPaths} from '@src/languages/types'; | ||||
import ONYXKEYS from '@src/ONYXKEYS'; | ||||
|
@@ -1682,10 +1683,10 @@ function getOptions( | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||||
userToInvite.alternateText = userToInvite.alternateText || searchValue; | ||||
|
||||
// If user doesn't exist, use a default avatar | ||||
// If user doesn't exist, always use the fallback avatar | ||||
userToInvite.icons = [ | ||||
{ | ||||
source: UserUtils.getAvatar('', optimisticAccountID), | ||||
source: FallbackAvatar, | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not specifying any source should by design fallback to the fallback avatart There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also found setting the source here causes imageError in Avatar in being true |
||||
name: searchValue, | ||||
type: CONST.ICON_TYPE_AVATAR, | ||||
}, | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this idea, but I'm worried there's a few places in app that are setting the fallback avatar as the avatar. For example here. Maybe we should just return nothing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/Expensify/App/blob/georgia-fallbackAvatars/src/libs/ReportUtils.ts#L1606-L1614
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing as this gets a little hazy, what if I remove this change from the PR (leaving only the theme support) and we handle all the fallback issues in #38743
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handling this separately sounds good to me 👍