azure-devops-ui
Version:
React components for building web UI in Azure DevOps
41 lines (40 loc) • 2.52 kB
JavaScript
import { __extends } from "tslib";
import "../../CommonImports";
import "../../Core/core.css";
import "./IdentityCard.css";
import * as React from "react";
import { css } from '../../Util';
import { Persona } from "../Persona/Persona";
import { PersonaSize } from "../Persona/Persona.Props";
import { CardContactLine } from "./CardContactLine";
var ServicePrincipalCard = /** @class */ (function (_super) {
__extends(ServicePrincipalCard, _super);
function ServicePrincipalCard() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.contactButtonRef = React.createRef();
return _this;
}
// Setting the focus for the case of default card mounting when we come back via back header
ServicePrincipalCard.prototype.componentDidMount = function () {
if (this.contactButtonRef.current) {
this.contactButtonRef.current.focus();
}
};
// Render
ServicePrincipalCard.prototype.render = function () {
var identity = this.props.identity;
var displayName = identity.displayName, mail = identity.mail, originId = identity.originId;
return (React.createElement("div", { className: css("bolt-identity-card-content flex-column scroll-hidden", "bolt-identity-default-card-without-header") },
React.createElement("div", { className: "flex-row" },
React.createElement(Persona, { className: "bolt-identity-card-persona-main", size: PersonaSize.size72, identity: this.props.identity, imageUrlResolver: this.props.imageUrlResolver }),
React.createElement("div", { className: "flex-column flex-grow bolt-identity-card-name scroll-hidden" },
React.createElement("div", { className: "word-wrap title-s" }, displayName),
React.createElement("div", { className: "word-wrap" }, mail))),
React.createElement("div", { className: "flex-column scroll-hidden" },
React.createElement("div", { className: "bolt-identity-default-card-info-wrapper " },
React.createElement("hr", { className: "bolt-identity-card-hr" }),
React.createElement("div", { className: "bolt-identity-default-card-contact-info-container flex-column scroll-hidden" }, originId && React.createElement(CardContactLine, { iconName: "ContactCard", content: originId }))))));
};
return ServicePrincipalCard;
}(React.Component));
export { ServicePrincipalCard };