1234567891011121314151617181920212223242526272829303132333435363738 |
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.CommentContext = undefined;
-
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
- exports.Comment = Comment;
-
- var _react = require("react");
-
- var _react2 = _interopRequireDefault(_react);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var CommentContext = _react2.default.createContext();
-
- // This function takes a component...
- function Comment(Component) {
- // ...and returns another component...
- return function (props) {
- // ... and renders the wrapped component with the context theme!
- // Notice that we pass through any additional props as well
- return _react2.default.createElement(
- CommentContext.Consumer,
- null,
- function (app) {
- return _react2.default.createElement(Component, _extends({}, props, { app: app }));
- }
- );
- };
- }
-
- exports.CommentContext = CommentContext;
- exports.default = Comment;
- //# sourceMappingURL=Comment.js.map
|