profile-pane
Version:
A SolidOS compatible pane to display a personal profile page
41 lines • 2.74 kB
JavaScript
;
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __assign = (this && this.__assign) || function () {
__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;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProfileCard = void 0;
var lit_html_1 = require("lit-html");
var style_map_js_1 = require("lit-html/directives/style-map.js");
var baseStyles_1 = require("./baseStyles");
var styles = {
image: (0, style_map_js_1.styleMap)((0, baseStyles_1.fullWidth)()),
intro: (0, style_map_js_1.styleMap)(__assign(__assign({}, (0, baseStyles_1.textGray)()), (0, baseStyles_1.textCenter)())),
info: (0, style_map_js_1.styleMap)((0, baseStyles_1.padding)()),
};
var ProfileCard = function (_a) {
var name = _a.name, imageSrc = _a.imageSrc, introduction = _a.introduction, location = _a.location, pronouns = _a.pronouns, highlightColor = _a.highlightColor;
var nameStyle = (0, style_map_js_1.styleMap)(__assign(__assign({}, (0, baseStyles_1.heading)()), { "text-decoration": "underline", "text-decoration-color": highlightColor }));
return (0, lit_html_1.html)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n <div style=", ">\n <h3 style=", ">", "</h3>\n <div style=", ">\n ", " ", " ", "\n </div>\n </div>\n "], ["\n ", "\n <div style=", ">\n <h3 style=", ">", "</h3>\n <div style=", ">\n ", " ", " ", "\n </div>\n </div>\n "])), Image(imageSrc, name), styles.info, nameStyle, name, styles.intro, Line(introduction), Line(location, "🌐"), Line(pronouns));
};
exports.ProfileCard = ProfileCard;
var Line = function (value, prefix) {
if (prefix === void 0) { prefix = lit_html_1.nothing; }
return value ? (0, lit_html_1.html)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["<p>", " ", "</p>"], ["<p>", " ", "</p>"])), prefix, value) : lit_html_1.nothing;
};
var Image = function (src, alt) {
return src ? (0, lit_html_1.html)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["<img style=", " src=", " alt=", " />"], ["<img style=", " src=", " alt=", " />"])), styles.image, src, alt) : lit_html_1.nothing;
};
var templateObject_1, templateObject_2, templateObject_3;
//# sourceMappingURL=ProfileCard.js.map