-
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
fix: regressions related to workspace avatars #41485
Changes from 5 commits
00dd36f
e8f3568
89c652b
b3e8557
9ca04c6
afdc4a0
1a416d2
1ad57da
18c70b4
be0f122
ce7f3a4
c911404
e602e57
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 |
---|---|---|
|
@@ -259,6 +259,9 @@ type MenuItemBaseProps = { | |
|
||
/** Handles what to do when the item is focused */ | ||
onFocus?: () => void; | ||
|
||
/** Optional account id if it's user avatar or policy id if it's workspace avatar */ | ||
accountID?: number | string; | ||
}; | ||
|
||
type MenuItemProps = (IconProps | AvatarProps | NoIcon) & MenuItemBaseProps; | ||
|
@@ -334,6 +337,7 @@ function MenuItem( | |
isPaneMenu = false, | ||
shouldPutLeftPaddingWhenNoIcon = false, | ||
onFocus, | ||
accountID = '', | ||
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. Can you point to me where in the code this will actually be used? because in this PR your not passing Also please don't default to 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. Thanks your comment |
||
}: MenuItemProps, | ||
ref: PressableRef, | ||
) { | ||
|
@@ -515,6 +519,7 @@ function MenuItem( | |
fallbackIcon={fallbackIcon} | ||
name={title} | ||
type={CONST.ICON_TYPE_WORKSPACE} | ||
accountID={accountID} | ||
/> | ||
)} | ||
{iconType === CONST.ICON_TYPE_AVATAR && ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ function ReportAvatar({report = {} as Report, policies, isLoadingApp = true}: Re | |
}} | ||
isWorkspaceAvatar | ||
maybeIcon | ||
originalFileName={policy?.originalFileName ?? policyName} | ||
originalFileName={policy?.originalFileName ?? policy?.id} | ||
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. Technically this will work, but the prop name is called 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 added a comment to explain, please check again 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. Can we add why we need to do this? 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.
@MonilBhavsar I added a comment. |
||
shouldShowNotFoundPage={!report?.reportID && !isLoadingApp} | ||
isLoading={(!report?.reportID || !policy?.id) && !!isLoadingApp} | ||
/> | ||
|
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.
Having a prop with name accountID and holding value of policyID is confusing IMO.
We can either have two props - policyID and accountID and use one that's provided -
policyID ?? accountID
Or, we can have a prop
avatarID
that takes either policyID or accountID.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 think
avatarID
is fine.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.
@MonilBhavsar I updated with new prop name