mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
Use t.map
This commit is contained in:
parent
b440bdcff0
commit
bba2d9f0a9
@ -14,12 +14,21 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import {TemplateView, InlineTemplateView} from "./general/TemplateView";
|
||||
import {TemplateView} from "./general/TemplateView";
|
||||
import {spinner} from "./common.js";
|
||||
|
||||
export class ForcedLogoutView extends TemplateView {
|
||||
render(t, vm) {
|
||||
const proceedView = new InlineTemplateView(vm, t => {
|
||||
render(t) {
|
||||
return t.div({ className: "LogoutScreen" }, [
|
||||
t.div({ className: "content" },
|
||||
t.map(vm => vm.showStatus, (showStatus, t, vm) => {
|
||||
if (showStatus) {
|
||||
return t.p({ className: "status" }, [
|
||||
spinner(t, { hidden: vm => !vm.showSpinner }),
|
||||
t.span(vm => vm.status)
|
||||
]);
|
||||
}
|
||||
else {
|
||||
return t.div([
|
||||
t.p("Your access token is no longer valid! You can reauthenticate in the next screen."),
|
||||
t.div({ className: "button-row" }, [
|
||||
@ -30,15 +39,7 @@ export class ForcedLogoutView extends TemplateView {
|
||||
}, vm.i18n`Proceed`)
|
||||
]),
|
||||
]);
|
||||
});
|
||||
const progressView = new InlineTemplateView(vm, t => {
|
||||
return t.p({className: "status"}, [spinner(t, {hidden: vm => !vm.showSpinner}), t.span(vm => vm.status)]);
|
||||
});
|
||||
|
||||
return t.div({className: "LogoutScreen"}, [
|
||||
t.div({className: "content"},
|
||||
t.mapView(vm => vm.showStatus, showStatus => {
|
||||
return showStatus? progressView: proceedView;
|
||||
}
|
||||
})
|
||||
),
|
||||
]);
|
||||
|
Loading…
Reference in New Issue
Block a user