office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
39 lines • 1.98 kB
JavaScript
import * as tslib_1 from "tslib";
// @codepen
import * as React from 'react';
import { Dialog, DialogType, DialogFooter } from 'office-ui-fabric-react/lib/Dialog';
import { PrimaryButton, DefaultButton } from 'office-ui-fabric-react/lib/Button';
var DialogBlockingExample = /** @class */ (function (_super) {
tslib_1.__extends(DialogBlockingExample, _super);
function DialogBlockingExample(props) {
var _this = _super.call(this, props) || this;
_this._showDialog = function () {
_this.setState({ hideDialog: false });
};
_this._closeDialog = function () {
_this.setState({ hideDialog: true });
};
_this.state = {
hideDialog: true
};
return _this;
}
DialogBlockingExample.prototype.render = function () {
return (React.createElement("div", null,
React.createElement(DefaultButton, { secondaryText: "Opens the Sample Dialog", onClick: this._showDialog, text: "Open Dialog" }),
React.createElement(Dialog, { hidden: this.state.hideDialog, onDismiss: this._closeDialog, dialogContentProps: {
type: DialogType.normal,
title: 'All emails together',
subText: 'Your Inbox has changed. No longer does it include favorites, it is a singular destination for your emails.'
}, modalProps: {
isBlocking: true,
containerClassName: 'ms-dialogMainOverride'
} },
React.createElement(DialogFooter, null,
React.createElement(PrimaryButton, { onClick: this._closeDialog, text: "Save" }),
React.createElement(DefaultButton, { onClick: this._closeDialog, text: "Cancel" })))));
};
return DialogBlockingExample;
}(React.Component));
export { DialogBlockingExample };
//# sourceMappingURL=Dialog.Blocking.Example.js.map