render grid view in session view

This commit is contained in:
Bruno Windels 2020-10-07 12:31:24 +02:00
parent dc1357bb31
commit 7955462dda

View file

@ -19,6 +19,7 @@ import {RoomView} from "./room/RoomView.js";
import {TemplateView} from "../general/TemplateView.js";
import {RoomPlaceholderView} from "./RoomPlaceholderView.js";
import {SessionStatusView} from "./SessionStatusView.js";
import {RoomGridView} from "./RoomGridView.js";
export class SessionView extends TemplateView {
render(t, vm) {
@ -31,11 +32,14 @@ export class SessionView extends TemplateView {
t.view(new SessionStatusView(vm.sessionStatusViewModel)),
t.div({className: "main"}, [
t.view(new LeftPanelView(vm.leftPanelViewModel)),
t.mapView(vm => vm.currentRoom, currentRoom => {
if (currentRoom) {
return new RoomView(currentRoom);
} else {
return new RoomPlaceholderView();
t.mapView(vm => vm.middlePanelViewType, middlePanelViewType => {
switch (middlePanelViewType) {
case "room":
return new RoomView(vm.currentRoom);
case "roomgrid":
return new RoomGridView(vm.roomGridViewModel);
case "placeholder":
return new RoomPlaceholderView();
}
})
])