@uifabric/experiments
Version:
Experimental React components for building experiences for Microsoft 365.
27 lines • 2.02 kB
JavaScript
define(["require", "exports", "../../Foundation", "../../utilities/factoryComponents", "./PersonaCoinImage/PersonaCoinImage", "./PersonaCoin.styles", "./propHelpers", "./PersonaCoinSize10/PersonaCoinSize10", "./PersonaCoinInitials/PersonaCoinInitials"], function (require, exports, Foundation_1, factoryComponents_1, PersonaCoinImage_1, PersonaCoin_styles_1, propHelpers_1, PersonaCoinSize10_1, PersonaCoinInitials_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
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