@5calls/react-components
Version:
React component library for 5 Calls webapp
43 lines (42 loc) • 1.72 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 __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var LoginUi_1 = require("./LoginUi");
var LoginService_1 = require("./LoginService");
var Login = /** @class */ (function (_super) {
__extends(Login, _super);
function Login(props) {
var _this = _super.call(this, props) || this;
_this.login = function () {
_this.loginService.login();
};
_this.logout = function () {
_this.props.logoutHandler();
};
_this.loginService = new LoginService_1.LoginService(_this.props.auth0Config);
return _this;
}
Login.prototype.render = function () {
return (React.createElement("div", null,
React.createElement(LoginUi_1.LoginUi, { profile: this.props.userProfile, login: this.login, logout: this.logout })));
};
return Login;
}(React.Component));
exports.Login = Login;