kea-react
Version:
Componentes comunes de react
44 lines (43 loc) • 1.74 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var 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 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");
/**Spinner de cargando */
var Spinner = /** @class */ (function (_super) {
__extends(Spinner, _super);
function Spinner() {
return _super !== null && _super.apply(this, arguments) || this;
}
Spinner.prototype.render = function () {
return React.createElement("i", { className: "fa fa-circle-o-notch fa-spin" });
};
return Spinner;
}(React.Component));
exports.Spinner = Spinner;
/**Muestra un componente hijo siempre y cuando no se este cargando o exista un error */
var Cargando = /** @class */ (function (_super) {
__extends(Cargando, _super);
function Cargando() {
return _super !== null && _super.apply(this, arguments) || this;
}
Cargando.prototype.render = function () {
return (this.props.Error ?
React.createElement("label", null,
"Error: ",
"" + this.props.Error) :
this.props.Cargando ?
React.createElement(Spinner, null) :
this.props.children);
};
return Cargando;
}(React.Component));
exports.Cargando = Cargando;