Skip to content

Commit 1f080d9

Browse files
authored
fix: display only available person-card contact icons on mgt-person-card (#3237)
1 parent 92c900c commit 1f080d9

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

packages/mgt-components/src/components/mgt-person-card/mgt-person-card.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -661,20 +661,22 @@ export class MgtPersonCard extends MgtTemplatedTaskComponent implements IHistory
661661
}
662662

663663
// Video
664-
665-
ariaLabel = `${this.strings.videoButtonLabel} ${person.displayName}`;
666-
const video: TemplateResult = html`
667-
<fluent-button class="icon"
668-
aria-label=${ariaLabel}
669-
@click=${this.videoCallUser}>
670-
${getSvg(SvgIcon.Video)}
671-
</fluent-button>
672-
`;
664+
let video: TemplateResult;
665+
if (userPerson?.userPrincipalName) {
666+
ariaLabel = `${this.strings.videoButtonLabel} ${person.displayName}`;
667+
video = html`
668+
<fluent-button class="icon"
669+
aria-label=${ariaLabel}
670+
@click=${this.videoCallUser}>
671+
${getSvg(SvgIcon.Video)}
672+
</fluent-button>
673+
`;
674+
}
673675

674676
// Call
675677
let call: TemplateResult;
676-
if (userPerson.userPrincipalName) {
677-
ariaLabel = `${this.strings.callButtonLabel} ${person.displayName}`;
678+
if (this.hasPhone) {
679+
ariaLabel = `${this.strings.callButtonLabel} ${userPerson.displayName}`;
678680
call = html`
679681
<fluent-button class="icon"
680682
aria-label=${ariaLabel}

0 commit comments

Comments
 (0)