opds-web-client
Version:
42 lines (41 loc) • 1.6 kB
JavaScript
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
var React = require("react");
var Root_1 = require("./Root");
var store_1 = require("../store");
var DataFetcher_1 = require("../DataFetcher");
var OPDSCatalog = (function (_super) {
__extends(OPDSCatalog, _super);
function OPDSCatalog(props) {
_super.call(this, props);
this.store = store_1.default(this.props.initialState || undefined);
this.state = { basicAuthCredentials: null };
}
OPDSCatalog.prototype.render = function () {
var props = Object.assign({}, this.props, {
store: this.store,
basicAuthCredentials: this.state.basicAuthCredentials
});
return (React.createElement(Root_1.default, __assign({}, props)));
};
OPDSCatalog.prototype.componentWillMount = function () {
this.setState({
basicAuthCredentials: new DataFetcher_1.default().getBasicAuthCredentials()
});
};
return OPDSCatalog;
}(React.Component));
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = OPDSCatalog;
;