From 80ea48e8a19f2633418a2bb338eba6d5c05083fc Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 19 Aug 2021 21:43:44 +0530 Subject: [PATCH] Move input into t.if Signed-off-by: RMidhunSuresh --- src/platform/web/ui/login/LoginView.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/platform/web/ui/login/LoginView.js b/src/platform/web/ui/login/LoginView.js index c15d69ba..bd087dd2 100644 --- a/src/platform/web/ui/login/LoginView.js +++ b/src/platform/web/ui/login/LoginView.js @@ -21,21 +21,23 @@ import {CompleteSSOView} from "./CompleteSSOView.js"; export class LoginView extends TemplateView { render(t, vm) { - const homeserver = t.input({ - id: "homeserver", - type: "text", - placeholder: vm.i18n`Your matrix homeserver`, - value: vm.defaultHomeServer, - onChange: () => vm.updateHomeServer(homeserver.value), - }); - return t.div({className: "PreSessionScreen"}, [ t.a({className: "button-utility LoginView_back", href: vm.cancelUrl}), t.div({className: "logo"}), t.h1([vm.i18n`Sign In`]), t.mapView(vm => vm.completeSSOLoginViewModel, vm => vm ? new CompleteSSOView(vm) : null), - t.if(vm => vm.showHomeserver, - (t, vm) => t.div({ className: "LoginView_sso form form-row" }, [t.label({ for: "homeserver" }, vm.i18n`Homeserver`), homeserver])), + t.if(vm => vm.showHomeserver, (t, vm) => t.div({ className: "LoginView_sso form form-row" }, + [ + t.label({for: "homeserver"}, vm.i18n`Homeserver`), + t.input({ + id: "homeserver", + type: "text", + placeholder: vm.i18n`Your matrix homeserver`, + value: vm.defaultHomeServer, + onChange: event => vm.updateHomeServer(event.target.value), + }) + ] + )), t.mapView(vm => vm.passwordLoginViewModel, vm => vm ? new PasswordLoginView(vm): null), t.if(vm => vm.passwordLoginViewModel && vm.startSSOLoginViewModel, t => t.p({className: "LoginView_separator"}, vm.i18n`or`)), t.mapView(vm => vm.startSSOLoginViewModel, vm => vm ? new StartSSOLoginView(vm) : null),