UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

38 lines 1.96 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var React = require("react"); var Dialog_1 = require("office-ui-fabric-react/lib/Dialog"); var Button_1 = require("office-ui-fabric-react/lib/Button"); var DialogBlockingExample = /** @class */ (function (_super) { tslib_1.__extends(DialogBlockingExample, _super); function DialogBlockingExample() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.state = { hideDialog: true }; _this._showDialog = function () { _this.setState({ hideDialog: false }); }; _this._closeDialog = function () { _this.setState({ hideDialog: true }); }; return _this; } DialogBlockingExample.prototype.render = function () { return (React.createElement("div", null, React.createElement(Button_1.DefaultButton, { secondaryText: "Opens the Sample Dialog", onClick: this._showDialog, text: "Open Dialog" }), React.createElement(Dialog_1.Dialog, { hidden: this.state.hideDialog, onDismiss: this._closeDialog, dialogContentProps: { type: Dialog_1.DialogType.normal, title: 'Missing Subject', subText: 'Do you want to send this message without a subject?' }, modalProps: { isBlocking: true, styles: { main: { maxWidth: 450 } } } }, React.createElement(Dialog_1.DialogFooter, null, React.createElement(Button_1.PrimaryButton, { onClick: this._closeDialog, text: "Send" }), React.createElement(Button_1.DefaultButton, { onClick: this._closeDialog, text: "Don't send" }))))); }; return DialogBlockingExample; }(React.Component)); exports.DialogBlockingExample = DialogBlockingExample; //# sourceMappingURL=Dialog.Blocking.Example.js.map