alm
Version:
The best IDE for TypeScript
68 lines (67 loc) • 3.32 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 __());
};
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var ui_1 = require("./ui");
var react_redux_1 = require("react-redux");
var ui = require("./ui");
require('./pendingRequestsIndicator.css');
var PendingRequestsIndicator = /** @class */ (function (_super) {
__extends(PendingRequestsIndicator, _super);
function PendingRequestsIndicator() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.handleClick = function () {
console.log(_this.props.pendingRequests);
ui.notifyInfoNormalDisappear("Pending Requests: " + _this.props.pendingRequests.join(' 🚴 '));
};
return _this;
}
PendingRequestsIndicator.prototype.componentWillReceiveProps = function () {
};
PendingRequestsIndicator.prototype.render = function () {
var pendingRequestsCount = this.props.pendingRequests.length;
var style = {
opacity: pendingRequestsCount ? 1 : 0,
transition: 'opacity .5s',
cursor: 'pointer'
};
var pendingRequestCountStyle = {
fontSize: '7px',
paddingRight: '2px',
color: '#2776b7'
};
return (React.createElement("span", { style: style, onClick: this.handleClick },
React.createElement("span", { style: pendingRequestCountStyle }, pendingRequestsCount),
React.createElement("span", { className: "loader" },
React.createElement("ul", null,
React.createElement("li", { className: "one" }),
React.createElement("li", { className: "two" }),
React.createElement("li", { className: "three" }),
React.createElement("li", { className: "four" }),
React.createElement("li", { className: "five" })))));
};
PendingRequestsIndicator = __decorate([
react_redux_1.connect(function (state) {
return {
pendingRequests: state.pendingRequests,
};
})
], PendingRequestsIndicator);
return PendingRequestsIndicator;
}(ui_1.BaseComponent));
exports.PendingRequestsIndicator = PendingRequestsIndicator;