Skip to content

Commit

Permalink
Merge pull request #42805 from Krishna2323/krishna2323/issue/42751
Browse files Browse the repository at this point in the history
[CP Staging] fix: Chat - Display Name Appears Black and Members Not Ticked in Group Preview

(cherry picked from commit 99b0563)
  • Loading branch information
luacmartins authored and OSBotify committed May 30, 2024
1 parent a6cd6e8 commit 851f4d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ function BaseSelectionList<TItem extends ListItem>(
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
// We're already handling the Enter key press in the useKeyboardShortcut hook, so we don't want the list item to submit the form
shouldPreventEnterKeySubmit
// Change this because of lint
rightHandSideComponent={rightHandSideComponent && (typeof rightHandSideComponent === 'function' ? rightHandSideComponent({} as TItem) : rightHandSideComponent)}
rightHandSideComponent={rightHandSideComponent}
keyForList={item.keyForList ?? ''}
isMultilineSupported={isRowMultilineSupported}
onFocus={() => {
Expand Down
13 changes: 9 additions & 4 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ import * as ReportActionsUtils from './ReportActionsUtils';
import StringUtils from './StringUtils';
import * as TransactionUtils from './TransactionUtils';
import * as Url from './Url';
<<<<<<< HEAD
import type * as UserUtils from './UserUtils';
=======
import type {AvatarSource} from './UserUtils';
import * as UserUtils from './UserUtils';
>>>>>>> 99b0563 (Merge pull request #42805 from Krishna2323/krishna2323/issue/42751)
type AvatarRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18;
Expand Down Expand Up @@ -117,7 +122,7 @@ type SpendBreakdown = {
totalDisplaySpend: number;
};
type ParticipantDetails = [number, string, UserUtils.AvatarSource, UserUtils.AvatarSource];
type ParticipantDetails = [number, string, AvatarSource, AvatarSource];
type OptimisticAddCommentReportAction = Pick<
ReportAction,
Expand Down Expand Up @@ -587,7 +592,7 @@ function getLastUpdatedReport(): OnyxEntry<Report> {
return lastUpdatedReport;
}

function getCurrentUserAvatar(): UserUtils.AvatarSource | undefined {
function getCurrentUserAvatar(): AvatarSource | undefined {
return currentUserPersonalDetails?.avatar;
}

Expand Down Expand Up @@ -1714,7 +1719,7 @@ function getDefaultWorkspaceAvatarTestID(workspaceName: string): string {
return !alphaNumeric ? defaultAvatarBuildingIconTestID : `SvgDefaultAvatar_${alphaNumeric[0]} Icon`;
}

function getWorkspaceAvatar(report: OnyxEntry<Report>): UserUtils.AvatarSource {
function getWorkspaceAvatar(report: OnyxEntry<Report>): AvatarSource {
const workspaceName = getPolicyName(report, false, allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]);
const avatar = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatarURL ?? '';
return !isEmpty(avatar) ? avatar : getDefaultWorkspaceAvatar(workspaceName);
Expand Down Expand Up @@ -1921,7 +1926,7 @@ function getParticipants(reportID: string) {
function getIcons(
report: OnyxEntry<Report>,
personalDetails: OnyxCollection<PersonalDetails>,
defaultIcon: UserUtils.AvatarSource | null = null,
defaultIcon: AvatarSource | null = null,
defaultName = '',
defaultAccountID = -1,
policy: OnyxEntry<Policy> = null,
Expand Down

0 comments on commit 851f4d8

Please sign in to comment.