UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

22 lines 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var Button_1 = require("office-ui-fabric-react/lib/Button"); var Panel_1 = require("office-ui-fabric-react/lib/Panel"); var react_hooks_1 = require("@uifabric/react-hooks"); var explanation = "This panel is non-modal: even when it's open, it allows interacting with content outside the panel."; exports.PanelNonModalExample = function () { var _a = React.useState(false), isOpen = _a[0], setIsOpen = _a[1]; var openPanel = react_hooks_1.useConstCallback(function () { return setIsOpen(true); }); var dismissPanel = react_hooks_1.useConstCallback(function () { return setIsOpen(false); }); return (React.createElement("div", null, explanation, React.createElement("br", null), React.createElement("br", null), React.createElement(Button_1.DefaultButton, { text: "Open panel", onClick: openPanel }), React.createElement(Panel_1.Panel, { headerText: "Non-modal panel", // this prop makes the panel non-modal isBlocking: false, isOpen: isOpen, onDismiss: dismissPanel, closeButtonAriaLabel: "Close" }, React.createElement("span", null, explanation)))); }; //# sourceMappingURL=Panel.NonModal.Example.js.map