UNPKG

@wix/design-system

Version:

@wix/design-system

84 lines 3.22 kB
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; import _createClass from "@babel/runtime/helpers/createClass"; import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; import _inherits from "@babel/runtime/helpers/inherits"; var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/Sidebar/docs/SidebarItemContextExample.jsx"; function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } import React from 'react'; import Sidebar, { SidebarItemContextConsumer } from '..'; var SidebarItemContextExample = /*#__PURE__*/function (_React$Component) { function SidebarItemContextExample() { _classCallCheck(this, SidebarItemContextExample); return _callSuper(this, SidebarItemContextExample, arguments); } _inherits(SidebarItemContextExample, _React$Component); return _createClass(SidebarItemContextExample, [{ key: "render", value: function render() { var _this = this; return /*#__PURE__*/React.createElement("div", { style: { height: '500px', color: 'white' }, __self: this, __source: { fileName: _jsxFileName, lineNumber: 7, columnNumber: 7 } }, /*#__PURE__*/React.createElement(Sidebar, { selectedKey: "item1", __self: this, __source: { fileName: _jsxFileName, lineNumber: 8, columnNumber: 9 } }, /*#__PURE__*/React.createElement(Sidebar.Item, { itemKey: "item1", __self: this, __source: { fileName: _jsxFileName, lineNumber: 9, columnNumber: 11 } }, /*#__PURE__*/React.createElement("div", { __self: this, __source: { fileName: _jsxFileName, lineNumber: 10, columnNumber: 13 } }, "Item 1")), /*#__PURE__*/React.createElement(Sidebar.Item, { itemKey: "item2", __self: this, __source: { fileName: _jsxFileName, lineNumber: 13, columnNumber: 11 } }, /*#__PURE__*/React.createElement(SidebarItemContextConsumer, { __self: this, __source: { fileName: _jsxFileName, lineNumber: 14, columnNumber: 13 } }, function (_ref) { var selected = _ref.selected; return /*#__PURE__*/React.createElement("div", { __self: _this, __source: { fileName: _jsxFileName, lineNumber: 16, columnNumber: 17 } }, "item2 is ", !selected() && 'not', " selected"); })))); } }]); }(React.Component); export { SidebarItemContextExample as default };