UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

37 lines 2.1 kB
import * as tslib_1 from "tslib"; import * as React from 'react'; import { autobind } from 'office-ui-fabric-react/lib/Utilities'; 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 = { imageUrl: TestImages.personaMale, imageInitials: 'TR', primaryText: 'Ted Randall', secondaryText: 'Project Manager', optionalText: 'Available at 4:00pm' }; var PersonaCustomCoinRenderExample = /** @class */ (function (_super) { tslib_1.__extends(PersonaCustomCoinRenderExample, _super); function PersonaCustomCoinRenderExample() { return _super !== null && _super.apply(this, arguments) || 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', coinSize: 72 })))); }; PersonaCustomCoinRenderExample.prototype._onRenderCoin = function (props) { var coinSize = props.coinSize, imageUrl = props.imageUrl, imageAlt = props.imageAlt; return (React.createElement("div", { className: 'customExampleCoin' }, React.createElement("img", { src: imageUrl, alt: imageAlt, width: coinSize, height: coinSize }))); }; tslib_1.__decorate([ autobind ], PersonaCustomCoinRenderExample.prototype, "_onRenderCoin", null); return PersonaCustomCoinRenderExample; }(React.Component)); export { PersonaCustomCoinRenderExample }; //# sourceMappingURL=Persona.CustomCoinRender.Example.js.map