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)) {