office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
33 lines • 1.92 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { Persona, PersonaSize, PersonaPresence } from 'office-ui-fabric-react/lib/Persona';
import { TestImages } from '../../../common/TestImages';
import './PersonaExample.scss';
import * as exampleStylesImport from '../../../common/_exampleStyles.scss';
var exampleStyles = exampleStylesImport;
var examplePersona = {
imageInitials: 'TR',
text: 'Ted Randall',
secondaryText: 'Project Manager',
optionalText: 'Available at 4:00pm'
};
var PersonaCustomCoinRenderExample = /** @class */ (function (_super) {
tslib_1.__extends(PersonaCustomCoinRenderExample, _super);
function PersonaCustomCoinRenderExample() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._onRenderCoin = function (props) {
var coinSize = props.coinSize, imageAlt = props.imageAlt, imageUrl = props.imageUrl;
return (React.createElement("div", { className: "customExampleCoin" },
React.createElement("img", { src: imageUrl, alt: imageAlt, width: coinSize, height: coinSize })));
};
return _this;
}
PersonaCustomCoinRenderExample.prototype.render = function () {
return (React.createElement("div", { className: "ms-PersonaExample" },
React.createElement("div", { className: exampleStyles.exampleLabel }, "Custom functional element in place of persona coin's image"),
React.createElement(Persona, tslib_1.__assign({}, examplePersona, { size: PersonaSize.size72, presence: PersonaPresence.online, onRenderCoin: this._onRenderCoin, imageAlt: 'Custom Coin Image', imageUrl: TestImages.personaMale, coinSize: 72 }))));
};
return PersonaCustomCoinRenderExample;
}(React.Component));
export { PersonaCustomCoinRenderExample };
//# sourceMappingURL=Persona.CustomCoinRender.Example.js.map