Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Sep 7, 2024
1 parent c0755f4 commit a8a6636
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pages/ReportParticipantDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ function ReportParticipantDetails({personalDetails, report, route}: ReportPartic
const member = report?.participants?.[accountID];
const details = personalDetails?.[accountID] ?? ({} as PersonalDetails);
const fallbackIcon = details.fallbackIcon ?? '';
const displayName = details.displayName ?? '';
const displayNameOrDefault = PersonalDetailsUtils.getDisplayNameOrDefault(details);
const displayName = PersonalDetailsUtils.getDisplayNameOrDefault(details);
const isCurrentUserAdmin = ReportUtils.isGroupChatAdmin(report, currentUserPersonalDetails?.accountID);
const isSelectedMemberCurrentUser = accountID === currentUserPersonalDetails?.accountID;
const removeUser = useCallback(() => {
Expand Down Expand Up @@ -93,12 +92,12 @@ function ReportParticipantDetails({personalDetails, report, route}: ReportPartic
size={CONST.AVATAR_SIZE.XLARGE}
fallbackIcon={fallbackIcon}
/>
{!!(displayNameOrDefault ?? '') && (
{!!(displayName ?? '') && (
<Text
style={[styles.textHeadline, styles.pre, styles.mb6, styles.w100, styles.textAlignCenter]}
numberOfLines={1}
>
{displayNameOrDefault}
{displayName}
</Text>
)}
{isCurrentUserAdmin && (
Expand Down

0 comments on commit a8a6636

Please sign in to comment.