@dorgtech/daocomponents
Version:
Componentizing [DAOstack's client library](https://github.com/daostack/client), enabling easier React application integration. The hope is to be able to turn any app into a DAO enabled dApp by adding ~2 components.
54 lines • 2.35 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var runtime_1 = require("../runtime");
var protocol_1 = require("../protocol");
var _1 = require("./");
var ArcSchemes = /** @class */ (function (_super) {
__extends(ArcSchemes, _super);
function ArcSchemes() {
return _super !== null && _super.apply(this, arguments) || this;
}
ArcSchemes.prototype.createObservableEntities = function () {
var _a = this.props, arcConfig = _a.arcConfig, filter = _a.filter;
if (!arcConfig) {
throw Error("Arc Config Missing: Please provide this field as a prop, or use the inference component.");
}
return _1.SchemeEntity.search(arcConfig.connection, filter);
};
ArcSchemes.prototype.renderComponent = function (entity, children) {
var arcConfig = this.props.arcConfig;
return (React.createElement(_1.ArcScheme, { id: entity.id, arcConfig: arcConfig }, children));
};
return ArcSchemes;
}(runtime_1.ComponentList));
exports.ArcSchemes = ArcSchemes;
var Schemes = /** @class */ (function (_super) {
__extends(Schemes, _super);
function Schemes() {
return _super !== null && _super.apply(this, arguments) || this;
}
Schemes.prototype.render = function () {
var _a = this.props, children = _a.children, sort = _a.sort, filter = _a.filter;
return (React.createElement(protocol_1.Arc.Config, null, function (arcConfig) {
return React.createElement(ArcSchemes, { arcConfig: arcConfig, sort: sort, filter: filter }, children);
}));
};
return Schemes;
}(React.Component));
exports.Schemes = Schemes;
exports.default = Schemes;
//# sourceMappingURL=Schemes.js.map