2020-08-05 22:08:55 +05:30
|
|
|
/*
|
|
|
|
Copyright 2020 Bruno Windels <bruno@windels.cloud>
|
2020-08-17 20:04:25 +05:30
|
|
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
2020-08-05 22:08:55 +05:30
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2020-04-21 00:56:39 +05:30
|
|
|
import {TemplateView} from "../../general/TemplateView.js";
|
|
|
|
import {TimelineList} from "./TimelineList.js";
|
2020-08-17 20:04:25 +05:30
|
|
|
import {TimelineLoadingView} from "./TimelineLoadingView.js";
|
2020-04-21 00:56:39 +05:30
|
|
|
import {MessageComposer} from "./MessageComposer.js";
|
2021-04-15 18:42:14 +05:30
|
|
|
import {AvatarView} from "../../avatar.js";
|
2019-02-28 03:20:08 +05:30
|
|
|
|
2020-04-21 00:56:39 +05:30
|
|
|
export class RoomView extends TemplateView {
|
2019-06-27 02:44:39 +05:30
|
|
|
render(t, vm) {
|
2020-10-19 18:22:18 +05:30
|
|
|
return t.main({className: "RoomView middle"}, [
|
2019-06-16 18:51:20 +05:30
|
|
|
t.div({className: "TimelinePanel"}, [
|
2020-10-19 18:22:18 +05:30
|
|
|
t.div({className: "RoomHeader middle-header"}, [
|
|
|
|
t.a({className: "button-utility close-middle", href: vm.closeUrl, title: vm.i18n`Close room`}),
|
2021-04-15 18:42:14 +05:30
|
|
|
t.view(new AvatarView(vm, 32)),
|
2019-06-16 18:51:20 +05:30
|
|
|
t.div({className: "room-description"}, [
|
|
|
|
t.h2(vm => vm.name),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
t.div({className: "RoomView_error"}, vm => vm.error),
|
2020-08-17 20:04:25 +05:30
|
|
|
t.mapView(vm => vm.timelineViewModel, timelineViewModel => {
|
|
|
|
return timelineViewModel ?
|
|
|
|
new TimelineList(timelineViewModel) :
|
|
|
|
new TimelineLoadingView(vm); // vm is just needed for i18n
|
|
|
|
}),
|
2021-04-22 20:53:41 +05:30
|
|
|
t.view(new MessageComposer(vm.composerViewModel)),
|
2019-06-16 18:51:20 +05:30
|
|
|
])
|
2019-02-28 03:20:08 +05:30
|
|
|
]);
|
2019-06-16 18:51:20 +05:30
|
|
|
}
|
2019-02-28 03:20:08 +05:30
|
|
|
}
|