UNPKG

@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.

48 lines 2.13 kB
"use strict"; 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 reactjs_popup_1 = require("reactjs-popup"); var R = require('ramda'); var Spinner = require("react-spinkit"); var LoadingView = /** @class */ (function (_super) { __extends(LoadingView, _super); function LoadingView() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.errors = []; _this.findErrorKeys = function (value, key) { if (value && value["_error"]) { var error_1 = value["_error"].message; // make sure the error isn't a duplicate var found = _this.errors.findIndex(function (err) { return err === error_1; }) > -1; if (!found) { _this.errors.push(error_1); } } }; return _this; } LoadingView.prototype.render = function () { var logs = this.props.logs; R.forEachObjIndexed(this.findErrorKeys, logs); return (React.createElement(reactjs_popup_1.default, { trigger: React.createElement(Spinner, { name: 'double-bounce' }), position: "right center", on: "hover", contentStyle: { width: "auto", display: "flex", flexWrap: "wrap" } }, React.createElement("div", null, this.errors.map(function (error) { return error; })))); }; return LoadingView; }(React.Component)); exports.default = LoadingView; //# sourceMappingURL=LoadingView.js.map