replace custom error view with staticview

This commit is contained in:
Bruno Windels 2020-10-14 11:26:39 +02:00
parent fa8bec0b56
commit de83d7740b

View File

@ -26,7 +26,12 @@ export class RootView extends TemplateView {
return t.mapView(vm => vm.activeSection, activeSection => { return t.mapView(vm => vm.activeSection, activeSection => {
switch (activeSection) { switch (activeSection) {
case "error": case "error":
return new StatusView({header: "Something went wrong", message: vm.errorText}); return new StaticView(t => {
return t.div({className: "StatusView"}, [
t.h1("Something went wrong"),
t.p(vm.errorText),
])
});
case "session": case "session":
return new SessionView(vm.sessionViewModel); return new SessionView(vm.sessionViewModel);
case "login": case "login":
@ -43,12 +48,3 @@ export class RootView extends TemplateView {
}); });
} }
} }
class StatusView extends TemplateView {
render(t, vm) {
return t.div({className: "StatusView"}, [
t.h1(vm.header),
t.p(vm.message),
]);
}
}