mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Add 'back' button to JoinRoomView
This commit is contained in:
parent
11f04fbc14
commit
df7774e8f4
@ -27,12 +27,16 @@ export class JoinRoomViewModel extends ViewModel<SegmentType, Options> {
|
||||
private _session: Session;
|
||||
private _joinInProgress: boolean = false;
|
||||
private _error: Error | undefined;
|
||||
private _closeUrl: string;
|
||||
|
||||
constructor(options: Readonly<Options>) {
|
||||
super(options);
|
||||
this._session = options.session;
|
||||
this._closeUrl = this.urlRouter.urlUntilSegment("session");
|
||||
}
|
||||
|
||||
get closeUrl(): string { return this._closeUrl; }
|
||||
|
||||
async join(roomId: string): Promise<void> {
|
||||
this._error = undefined;
|
||||
this._joinInProgress = true;
|
||||
|
@ -27,7 +27,10 @@ export class JoinRoomView extends TemplateView<JoinRoomViewModel> {
|
||||
placeholder: vm.i18n`Enter a room id or alias`,
|
||||
disabled: vm => vm.joinInProgress,
|
||||
});
|
||||
return t.main({className: "JoinRoomView middle"},
|
||||
return t.main({className: "JoinRoomView middle"}, [
|
||||
t.div({className: "JoinRoomView_header middle-header"}, [
|
||||
t.a({className: "button-utility close-middle", href: vm.closeUrl, title: vm.i18n`Cancel room join`}),
|
||||
]),
|
||||
t.div({className: "JoinRoomView_body centered-column"}, [
|
||||
t.h2("Join room"),
|
||||
t.form({className: "JoinRoomView_detailsForm form", onSubmit: evt => this.onSubmit(evt, input.value)}, [
|
||||
@ -52,7 +55,7 @@ export class JoinRoomView extends TemplateView<JoinRoomViewModel> {
|
||||
})
|
||||
])
|
||||
])
|
||||
);
|
||||
]);
|
||||
}
|
||||
|
||||
onSubmit(evt, id) {
|
||||
|
Loading…
Reference in New Issue
Block a user