matrix-public-archive/shared/views/RightPanelContentView.js

65 lines
1.9 KiB
JavaScript
Raw Normal View History

2022-02-15 20:33:31 -07:00
'use strict';
2022-02-10 01:21:49 -07:00
const { TemplateView } = require('hydrogen-view-sdk');
const CalendarView = require('matrix-public-archive-shared/views/CalendarView');
const TimeSelectorView = require('matrix-public-archive-shared/views/TimeSelectorView');
const assert = require('matrix-public-archive-shared/lib/assert');
2022-02-14 20:11:55 -07:00
2022-02-10 01:21:49 -07:00
class RightPanelContentView extends TemplateView {
render(t, vm) {
assert(vm.shouldIndex !== undefined);
assert(vm.shouldShowTimeSelector !== undefined);
let maybeIndexedMessage = 'This room is not being indexed by search engines.';
if (vm.shouldIndex) {
maybeIndexedMessage = 'This room is being indexed by search engines.';
}
2022-02-10 01:21:49 -07:00
return t.div(
{
className: 'RightPanelContentView',
2022-02-10 01:21:49 -07:00
},
[
t.div({ className: 'RightPanelContentView_mainContent' }, [
t.view(new CalendarView(vm.calendarViewModel)),
t.ifView(
(vm) => vm.shouldShowTimeSelector,
(vm) => new TimeSelectorView(vm.timeSelectorViewModel)
),
]),
t.footer(
{
className: 'RightPanelContentView_footer',
},
[
t.p(maybeIndexedMessage),
t.div(
{
className: 'RightPanelContentView_footerLinkList',
},
[
t.a(
{ className: 'RightPanelContentView_footerLink', href: vm.developerOptionsUrl },
['Developer options']
),
t.span('·'),
t.a(
{
className: 'RightPanelContentView_footerLink',
href: 'https://matrix.org/',
target: '_blank',
},
['Matrix.org']
),
]
),
]
),
]
2022-02-10 01:21:49 -07:00
);
}
}
module.exports = RightPanelContentView;