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

77 lines
2.3 KiB
JavaScript
Raw Permalink 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');
2023-05-30 23:54:43 -06:00
const assert = require('matrix-public-archive-shared/lib/assert');
const CalendarView = require('matrix-public-archive-shared/views/CalendarView');
const TimeSelectorView = require('matrix-public-archive-shared/views/TimeSelectorView');
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);
2023-05-30 23:54:43 -06:00
let maybeIndexedMessage = 'This room is not being indexed by search engines ';
if (vm.shouldIndex) {
2023-05-30 23:54:43 -06:00
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',
},
[
2023-05-30 23:54:43 -06:00
t.p([
maybeIndexedMessage,
'(',
t.a(
{
className: 'external-link RightPanelContentView_footerLink',
href: 'https://github.com/matrix-org/matrix-public-archive/blob/main/docs/faq.md#how-do-i-opt-out-and-keep-my-room-from-being-indexed-by-search-engines',
target: '_blank',
},
'more info'
),
').',
]),
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;