Group contact messages, and try to fix some messages overflowing width.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4238 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-03-19 23:31:08 +00:00
parent bdeee7fc0e
commit 3d2c88c201
4 changed files with 45 additions and 23 deletions

View File

@ -19,18 +19,23 @@ class TfUserElement extends LitElement {
}
render() {
let name = this.users?.[this.id]?.name;
name = name !== undefined ?
html`<a target="_top" href=${'#' + this.id}>${name}</a>` :
html`<a target="_top" href=${'#' + this.id}>${this.id}</a>`;
if (this.users[this.id]) {
let image = this.users[this.id].image;
image = typeof(image) == 'string' ? image : image?.link;
return html`
<div style="display: inline-block; font-weight: bold">
<img style="width: 2em; height: 2em; vertical-align: middle; border-radius: 50%" ?hidden=${image === undefined} src="${image ? '/' + image + '/view' : undefined}">
<a target="_top" href=${'#' + this.id}>${this.users[this.id].name ?? this.id}</a>
<img style="width: 2em; height: 2em; vertical-align: middle; border-radius: 50%" ?hidden=${image === undefined} src="${image ? '/' + image + '/view' : undefined}">
${name}
</div>`;
} else {
return html`
<div style="display: inline-block; font-weight: bold; word-wrap: anywhere">
<a target="_top" href=${'#' + this.id}>${this.id}</a>
<div style="display: inline-block; font-weight: bold">
${name}
</div>`;
}
}