Put up a temporary loading view

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-06-25 20:46:15 +05:30
parent ef40027502
commit 3d4ba20150
2 changed files with 9 additions and 2 deletions

View File

@ -1,9 +1,16 @@
import {TemplateView} from "../../general/TemplateView.js";
import {ListView} from "../../general/ListView.js";
import {MemberTileView} from "./MemberTileView.js";
import {spinner} from "../../common.js";
export class MemberListView extends TemplateView {
render(t, vm) {
return t.view(new ListView({list: vm.memberTileViewModels, className:"MemberListView"}, tileViewModel => new MemberTileView(tileViewModel)));
}
}
export class MemberListLoadingView extends TemplateView {
render(t) {
return t.div(["Loading ", spinner(t)]);
}
}

View File

@ -1,13 +1,13 @@
import {TemplateView} from "../../general/TemplateView.js";
import {RoomDetailsView} from "./RoomDetailsView.js";
import {MemberListView} from "./MemberListView.js";
import {MemberListLoadingView, MemberListView} from "./MemberListView.js";
export class RightPanelView extends TemplateView {
render(t) {
return t.div({className: "RightPanelView"},
[
t.mapView(vm => vm.roomDetailsViewModel, roomDetailsViewModel => roomDetailsViewModel ? new RoomDetailsView(roomDetailsViewModel) : null),
t.mapView(vm => vm.memberListViewModel, memberListViewModel => memberListViewModel ? new MemberListView(memberListViewModel) : null)
t.mapView(vm => vm.memberListViewModel, memberListViewModel => memberListViewModel ? new MemberListView(memberListViewModel) : new MemberListLoadingView())
]
);
}