@raona/components
Version:
React components used at Raona to work with SPFx
45 lines (44 loc) • 2.51 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 react_1 = require("react");
var LibraryCard = /** @class */ (function (_super) {
__extends(LibraryCard, _super);
function LibraryCard() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.defaultIcon = 'icon-apps';
return _this;
}
LibraryCard.prototype.render = function () {
var item = this.props.item;
return (React.createElement("div", null, item &&
React.createElement("div", { className: "card" },
React.createElement("a", { href: item.redirectUrl, target: '_blank' },
React.createElement("div", { className: "card__wrapper card__wrapper--library" },
React.createElement("div", { className: "card__header card__header--library" },
React.createElement("span", { className: "card__libIcon " + (item.iconClassName ? item.iconClassName : this.defaultIcon) })),
React.createElement("div", { className: "card__body card__body--library" },
React.createElement("p", { className: "card__title card__title--library" }, item.title),
item.versioningInfo &&
React.createElement("p", { className: "card__info card__info--library" },
item.others && item.others[0],
" ",
React.createElement("span", { className: "card__category" }, item.versioningInfo.modified)),
React.createElement("p", { className: "card__linkHover" }, item.others && item.others[1])))))));
};
return LibraryCard;
}(react_1.Component));
exports.LibraryCard = LibraryCard;
;