forked from mystiq/hydrogen-web
Convert link to button
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
d47e126370
commit
04806a1425
2 changed files with 13 additions and 3 deletions
|
@ -49,11 +49,15 @@ export class LoginViewModel extends ViewModel {
|
||||||
get homeserver() { return this._homeserver; }
|
get homeserver() { return this._homeserver; }
|
||||||
get errorMessage() { return this._errorMessage; }
|
get errorMessage() { return this._errorMessage; }
|
||||||
get showHomeserver() { return !this._hideHomeserver; }
|
get showHomeserver() { return !this._hideHomeserver; }
|
||||||
get cancelUrl() { return this.urlCreator.urlForSegment("session"); }
|
|
||||||
get loadViewModel() {return this._loadViewModel; }
|
get loadViewModel() {return this._loadViewModel; }
|
||||||
get isBusy() { return this._isBusy; }
|
get isBusy() { return this._isBusy; }
|
||||||
get isFetchingLoginOptions() { return this._isFetchingLoginOptions; }
|
get isFetchingLoginOptions() { return this._isFetchingLoginOptions; }
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
const path = this.navigation.pathFrom([this.navigation.segment("session")]);
|
||||||
|
this.navigation.applyPath(path);
|
||||||
|
}
|
||||||
|
|
||||||
async _createViewModels(homeserver) {
|
async _createViewModels(homeserver) {
|
||||||
if (this._loginToken) {
|
if (this._loginToken) {
|
||||||
this._hideHomeserver = true;
|
this._hideHomeserver = true;
|
||||||
|
|
|
@ -23,8 +23,14 @@ import {spinner} from "../common.js";
|
||||||
|
|
||||||
export class LoginView extends TemplateView {
|
export class LoginView extends TemplateView {
|
||||||
render(t, vm) {
|
render(t, vm) {
|
||||||
|
const disabled = vm => vm.isBusy;
|
||||||
|
|
||||||
return t.div({className: "PreSessionScreen"}, [
|
return t.div({className: "PreSessionScreen"}, [
|
||||||
t.a({className: "button-utility LoginView_back", href: vm.cancelUrl}),
|
t.button({
|
||||||
|
className: "button-utility LoginView_back",
|
||||||
|
onClick: () => vm.goBack(),
|
||||||
|
disabled
|
||||||
|
}),
|
||||||
t.div({className: "logo"}),
|
t.div({className: "logo"}),
|
||||||
t.h1([vm.i18n`Sign In`]),
|
t.h1([vm.i18n`Sign In`]),
|
||||||
t.mapView(vm => vm.completeSSOLoginViewModel, vm => vm ? new CompleteSSOView(vm) : null),
|
t.mapView(vm => vm.completeSSOLoginViewModel, vm => vm ? new CompleteSSOView(vm) : null),
|
||||||
|
@ -37,7 +43,7 @@ export class LoginView extends TemplateView {
|
||||||
type: "text",
|
type: "text",
|
||||||
placeholder: vm.i18n`Your matrix homeserver`,
|
placeholder: vm.i18n`Your matrix homeserver`,
|
||||||
value: vm.homeserver,
|
value: vm.homeserver,
|
||||||
disabled: vm => vm.isBusy,
|
disabled,
|
||||||
onChange: event => vm.updateHomeServer(event.target.value),
|
onChange: event => vm.updateHomeServer(event.target.value),
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue