oak-general-business/lib/components/my/avatar/index.js

33 lines
1.0 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = OakComponent({
isList: false,
properties: {
shape: 'circle',
size: 0,
iconColor: 'primary',
iconName: 'user',
},
formData: function (_a) {
var _b;
var features = _a.features;
var userInfo = features.token.getUserInfo();
if (userInfo) {
var extraFile = (_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo.extraFile$entity) === null || _b === void 0 ? void 0 : _b.find(function (ele) { return ele.tag1 === 'avatar'; });
var avatarUrl = extraFile && features.extraFile.getUrl(extraFile);
return {
avatarUrl: avatarUrl,
};
}
return {
avatarUrl: '',
};
},
lifetimes: {
attached: function () {
var _this = this;
this.subscribed.push(this.features.token.subscribe(function () { return _this.reRender(); }));
},
},
});