Add a thing to inspect reactions. #48

This commit is contained in:
2024-04-21 14:18:06 -04:00
parent bd14168627
commit 628716ec28
6 changed files with 64 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import {LitElement, html, unsafeHTML} from './lit-all.min.js';
import {LitElement, html, render, unsafeHTML} from './lit-all.min.js';
import * as tfrpc from '/static/tfrpc.js';
import * as tfutils from './tf-utils.js';
import * as emojis from './emojis.js';
@ -54,6 +54,12 @@ class TfMessageElement extends LitElement {
);
}
show_reactions() {
let modal = document.getElementById('reactions_modal');
modal.users = this.users;
modal.votes = this.message?.votes || [];
}
render_votes() {
function normalize_expression(expression) {
if (expression === 'Like' || !expression) {
@ -66,7 +72,10 @@ class TfMessageElement extends LitElement {
return expression;
}
}
return html`<div>
return html`<div
class="w3-button"
@click=${this.show_reactions}
>
${(this.message.votes || []).map(
(vote) => html`
<span