From 15048bd9c34c4227e7d73ba3489120a9eabd95df Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 26 May 2021 13:11:20 +0200 Subject: [PATCH] very basic redact button on all text messages --- src/platform/web/ui/session/room/timeline/TextMessageView.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/web/ui/session/room/timeline/TextMessageView.js b/src/platform/web/ui/session/room/timeline/TextMessageView.js index dc5550ee..6a3b8ed5 100644 --- a/src/platform/web/ui/session/room/timeline/TextMessageView.js +++ b/src/platform/web/ui/session/room/timeline/TextMessageView.js @@ -22,8 +22,9 @@ import {renderMessage} from "./common.js"; export class TextMessageView extends TemplateView { render(t, vm) { const bodyView = t.mapView(vm => vm.body, body => new BodyView(body)); + const redactButton = t.button({onClick: () => vm.redact()}, "Redact"); return renderMessage(t, vm, - [t.p([bodyView, t.time({className: {hidden: !vm.date}}, vm.date + " " + vm.time)])] + [t.p([bodyView, redactButton, t.time({className: {hidden: !vm.date}}, vm.date + " " + vm.time)])] ); } }