-
-
Notifications
You must be signed in to change notification settings - Fork 436
/
Copy pathnotification-center-component.tsx
64 lines (62 loc) · 2.34 KB
/
notification-center-component.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import * as React from 'react';
import { NotificationComponent } from './notification-component';
import { NotificationCenterComponent as TheiaNotificationCenterComponent } from '@theia/messages/lib/browser/notification-center-component';
import { nls } from '@theia/core/lib/common';
import { codicon } from '@theia/core/lib/browser';
const PerfectScrollbar = require('react-perfect-scrollbar');
export class NotificationCenterComponent extends TheiaNotificationCenterComponent {
render(): React.ReactNode {
const empty = this.state.notifications.length === 0;
const title = empty
? nls.localize(
'vscode/notificationsCenter/notificationsEmpty',
'NO NEW NOTIFICATIONS'
)
: nls.localize(
'vscode/notificationsCenter/notifications',
'NOTIFICATIONS'
);
return (
<div
className={`theia-notifications-container theia-notification-center ${
this.state.visibilityState === 'center' ? 'open' : 'closed'
}`}
>
<div className="theia-notification-center-header">
<div className="theia-notification-center-header-title">{title}</div>
<div className="theia-notification-center-header-actions">
<ul className="theia-notification-actions">
<li
className={codicon('chevron-down', true)}
title={nls.localize(
'vscode/notificationsStatus/hideNotifications',
'Hide Notification Center'
)}
onClick={this.onHide}
/>
<li
className={codicon('clear-all', true)}
title={nls.localize(
'vscode/notificationsCommands/clearAllNotifications',
'Clear All'
)}
onClick={this.onClearAll}
/>
</ul>
</div>
</div>
<PerfectScrollbar className="theia-notification-list-scroll-container">
<div className="theia-notification-list">
{this.state.notifications.map((notification) => (
<NotificationComponent
key={notification.messageId}
notification={notification}
manager={this.props.manager}
/>
))}
</div>
</PerfectScrollbar>
</div>
);
}
}