office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
37 lines (35 loc) • 1.72 kB
JavaScript
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
define(["require", "exports", "react", "../../../../index", "./Overlay.Example.scss"], function (require, exports, React, index_1) {
"use strict";
var OverlayDarkExample = (function (_super) {
__extends(OverlayDarkExample, _super);
function OverlayDarkExample() {
var _this = _super.call(this) || this;
_this._onClick = _this._onClick.bind(_this);
_this.state = {
isOverlayVisible: false
};
return _this;
}
OverlayDarkExample.prototype.render = function () {
var isOverlayVisible = this.state.isOverlayVisible;
return (React.createElement("div", null,
React.createElement(index_1.Button, { onClick: this._onClick }, "Show the overlay"),
isOverlayVisible && (React.createElement(index_1.Overlay, { isDarkThemed: true, onClick: this._onClick },
React.createElement("div", { className: 'OverlayExample-content' },
React.createElement("p", null, "I am content within the overlay."))))));
};
OverlayDarkExample.prototype._onClick = function () {
this.setState({
isOverlayVisible: !this.state.isOverlayVisible
});
};
return OverlayDarkExample;
}(React.Component));
exports.OverlayDarkExample = OverlayDarkExample;
});
//# sourceMappingURL=Overlay.Dark.Example.js.map