mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Add a very basic, unstyled view of the message to the composer.
This commit is contained in:
parent
94ae5faa3c
commit
66f686210f
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user