UNPKG

@uifabric/experiments

Version:

Experimental React components for building experiences for Office 365.

33 lines 2.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** @jsx withSlots */ var Foundation_1 = require("../../Foundation"); var factoryComponents_1 = require("../../utilities/factoryComponents"); var PersonaCoinImage_1 = require("./PersonaCoinImage/PersonaCoinImage"); var PersonaCoin_styles_1 = require("./PersonaCoin.styles"); var propHelpers_1 = require("./propHelpers"); var PersonaCoinSize10_1 = require("./PersonaCoinSize10/PersonaCoinSize10"); var PersonaCoinInitials_1 = require("./PersonaCoinInitials/PersonaCoinInitials"); exports.PersonaCoinView = function (props) { var coinSize = props.size || PersonaCoin_styles_1.DEFAULT_PERSONA_COIN_SIZE; var Slots = Foundation_1.getSlots(props, { root: 'div', image: PersonaCoinImage_1.PersonaCoinImage, initials: PersonaCoinInitials_1.PersonaCoinInitials, presence: factoryComponents_1.PersonaPresence, personaCoinSize10: PersonaCoinSize10_1.default }); if (coinSize === 10) { if (props.presence) { // TODO: why do we need to pass size twice? return Foundation_1.withSlots(Slots.presence, { coinSize: coinSize, size: coinSize }); } return Foundation_1.withSlots(Slots.personaCoinSize10, null); } var initials = propHelpers_1.hideInitialsWhenImageIsLoaded(props) ? null : (Foundation_1.withSlots(Slots.initials, { initials: props.initials, text: props.text, allowPhoneInitials: props.allowPhoneInitials })); return (Foundation_1.withSlots(Slots.root, null, initials, Foundation_1.withSlots(Slots.image, { src: props.imageUrl, dimension: coinSize, onPhotoLoadingStateChange: props.onPhotoLoadingStateChange, imageShouldFadeIn: props.imageShouldFadeIn, imageShouldStartVisible: props.imageShouldStartVisible, imageAlt: props.imageAlt }), Foundation_1.withSlots(Slots.presence, { coinSize: coinSize, size: coinSize }))); }; //# sourceMappingURL=PersonaCoin.view.js.map