office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
36 lines • 1.85 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 { Icon } from 'office-ui-fabric-react/lib/Icon';
import { TestImages } from '../../../common/TestImages';
import './PersonaExample.scss';
import * as exampleStylesImport from '../../../common/_exampleStyles.scss';
var exampleStyles = exampleStylesImport;
var examplePersona = {
imageUrl: TestImages.personaFemale,
imageInitials: 'AL',
text: 'Annie Lindqvist',
secondaryText: 'Software Engineer',
tertiaryText: 'In a meeting',
optionalText: 'Available at 4:00pm'
};
var PersonaCustomRenderExample = /** @class */ (function (_super) {
tslib_1.__extends(PersonaCustomRenderExample, _super);
function PersonaCustomRenderExample() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._onRenderSecondaryText = function (props) {
return (React.createElement("div", null,
React.createElement(Icon, { iconName: 'Suitcase', className: 'ms-JobIconExample' }),
props.secondaryText));
};
return _this;
}
PersonaCustomRenderExample.prototype.render = function () {
return (React.createElement("div", { className: "ms-PersonaExample" },
React.createElement("div", { className: exampleStyles.exampleLabel }, "Custom icon in secondary text"),
React.createElement(Persona, tslib_1.__assign({}, examplePersona, { size: PersonaSize.size72, presence: PersonaPresence.offline, onRenderSecondaryText: this._onRenderSecondaryText }))));
};
return PersonaCustomRenderExample;
}(React.Component));
export { PersonaCustomRenderExample };
//# sourceMappingURL=Persona.CustomRender.Example.js.map