Add a very basic, unstyled view of the message to the composer.

This commit is contained in:
Danila Fedorin 2021-07-22 12:28:24 -07:00
parent 94ae5faa3c
commit 66f686210f

View file

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