From 66f686210fb9d9092ecc1f7c9439921c957d304f Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 22 Jul 2021 12:28:24 -0700 Subject: [PATCH] Add a very basic, unstyled view of the message to the composer. --- .../web/ui/session/room/MessageComposer.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/platform/web/ui/session/room/MessageComposer.js b/src/platform/web/ui/session/room/MessageComposer.js index 95f48747..ac4f59f5 100644 --- a/src/platform/web/ui/session/room/MessageComposer.js +++ b/src/platform/web/ui/session/room/MessageComposer.js @@ -17,6 +17,7 @@ limitations under the License. import {TemplateView} from "../../general/TemplateView.js"; import {Popup} from "../../general/Popup.js"; import {Menu} from "../../general/Menu.js"; +import {TextMessageView} from "./timeline/TextMessageView.js"; export class MessageComposer extends TemplateView { constructor(viewModel) { @@ -33,6 +34,16 @@ export class MessageComposer extends TemplateView { onInput: () => vm.setInput(this._input.value), }); return t.div({className: "MessageComposer"}, [ + t.map(vm => vm.replyViewModel, (rvm, t) => !rvm ? null : + t.div({ + className: "replyBox" + }, [ + t.span('Replying'), + t.span({onClick: () => this._clearReplyingTo()}, 'Close'), + // TODO need proper view, not just assumed TextMessageView + t.view(new TextMessageView(vm.replyViewModel, true)) + ]) + ), this._input, t.button({ className: "sendFile", @@ -48,6 +59,10 @@ export class MessageComposer extends TemplateView { ]); } + _clearReplyingTo() { + this.value.clearReplyingTo(); + } + _trySend() { this._input.focus(); if (this.value.sendMessage(this._input.value)) {