This repository has been archived on 2022-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
hydrogen-web/src/ui/web/session/room/RoomView.js

48 lines
1.4 KiB
JavaScript
Raw Normal View History

import TemplateView from "../../general/TemplateView.js";
import TimelineList from "./TimelineList.js";
export default class RoomView extends TemplateView {
constructor(viewModel) {
super(viewModel, true);
this._timelineList = null;
this._checkScroll = this._checkScroll.bind(this);
}
render(t) {
return t.div({className: "RoomView"}, [
t.div({className: "TimelinePanel"}, [
t.div({className: "RoomHeader"}, [
t.button({className: "back"}),
t.div({className: "avatar large"}, vm => vm.avatarInitials),
t.div({className: "room-description"}, [
t.h2(vm => vm.name),
]),
]),
t.div({className: "RoomView_error"}, vm => vm.error),
this._timelineList.mount()
])
]);
}
mount() {
this._timelineList = new TimelineList();
return super.mount();
}
unmount() {
this._timelineList.unmount();
super.unmount();
}
update(value, prop) {
super.update(value, prop);
if (prop === "timelineViewModel") {
this._timelineList.update({list: this.viewModel.timelineViewModel.tiles});
}
}
_checkScroll() {
// const list = this._timelineList.root();
}
}