diff --git a/src/domain/session/JoinRoomViewModel.ts b/src/domain/session/JoinRoomViewModel.ts index 1b7148f9..a310c524 100644 --- a/src/domain/session/JoinRoomViewModel.ts +++ b/src/domain/session/JoinRoomViewModel.ts @@ -27,12 +27,16 @@ export class JoinRoomViewModel extends ViewModel { private _session: Session; private _joinInProgress: boolean = false; private _error: Error | undefined; + private _closeUrl: string; constructor(options: Readonly) { super(options); this._session = options.session; + this._closeUrl = this.urlRouter.urlUntilSegment("session"); } + get closeUrl(): string { return this._closeUrl; } + async join(roomId: string): Promise { this._error = undefined; this._joinInProgress = true; diff --git a/src/platform/web/ui/session/JoinRoomView.ts b/src/platform/web/ui/session/JoinRoomView.ts index c26cc34e..381662b4 100644 --- a/src/platform/web/ui/session/JoinRoomView.ts +++ b/src/platform/web/ui/session/JoinRoomView.ts @@ -27,7 +27,10 @@ export class JoinRoomView extends TemplateView { 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 { }) ]) ]) - ); + ]); } onSubmit(evt, id) {