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