UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

37 lines 2.15 kB
import * as tslib_1 from "tslib"; import * as React from 'react'; import { DefaultButton } from 'office-ui-fabric-react/lib/Button'; import { TeachingBubble } from 'office-ui-fabric-react/lib/TeachingBubble'; var TeachingBubbleCondensedExample = /** @class */ (function (_super) { tslib_1.__extends(TeachingBubbleCondensedExample, _super); function TeachingBubbleCondensedExample(props) { var _this = _super.call(this, props) || this; _this._onDismiss = _this._onDismiss.bind(_this); _this._onShow = _this._onShow.bind(_this); _this.state = { isTeachingBubbleVisible: false }; return _this; } TeachingBubbleCondensedExample.prototype.render = function () { var isTeachingBubbleVisible = this.state.isTeachingBubbleVisible; return (React.createElement("div", { className: "ms-TeachingBubbleExample" }, React.createElement("span", { className: "ms-TeachingBubbleBasicExample-buttonArea" }, React.createElement(DefaultButton, { onClick: isTeachingBubbleVisible ? this._onDismiss : this._onShow, text: isTeachingBubbleVisible ? 'Hide TeachingBubble' : 'Show TeachingBubble', id: 'buttonId' })), isTeachingBubbleVisible ? (React.createElement("div", null, React.createElement(TeachingBubble, { target: '#buttonId', hasCondensedHeadline: true, onDismiss: this._onDismiss, hasCloseIcon: true, closeButtonAriaLabel: "Close", headline: "Discover what\u2019s trending around you" }, "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facere, nulla, ipsum? Molestiae quis aliquam magni harum non?"))) : null)); }; TeachingBubbleCondensedExample.prototype._onDismiss = function (ev) { this.setState({ isTeachingBubbleVisible: false }); }; TeachingBubbleCondensedExample.prototype._onShow = function (ev) { this.setState({ isTeachingBubbleVisible: true }); }; return TeachingBubbleCondensedExample; }(React.Component)); export { TeachingBubbleCondensedExample }; //# sourceMappingURL=TeachingBubble.Condensed.Example.js.map