Skip to content

Commit d1d3758

Browse files
refactor(core): improve extensibility of NotificationList DOM
1 parent fee2d69 commit d1d3758

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

framework/core/js/src/forum/components/NotificationList.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,27 @@ import Tooltip from '../../common/components/Tooltip';
1414
*/
1515
export default class NotificationList extends Component {
1616
view() {
17+
return <div className="NotificationList">{this.viewItems().toArray()}</div>;
18+
}
19+
20+
viewItems() {
1721
const state = this.attrs.state;
22+
const items = new ItemList();
1823

19-
return (
20-
<div className="NotificationList">
21-
<div className="NotificationList-header">
22-
<h4 className="App-titleControl App-titleControl--text">{app.translator.trans('core.forum.notifications.title')}</h4>
24+
items.add('header', <div className="NotificationList-header">{this.headerItems().toArray()}</div>, 100);
2325

24-
<div className="App-primaryControl">{this.controlItems().toArray()}</div>
25-
</div>
26+
items.add('content', <div className="NotificationList-content">{this.content(state)}</div>, 90);
2627

27-
<div className="NotificationList-content">{this.content(state)}</div>
28-
</div>
29-
);
28+
return items;
29+
}
30+
31+
headerItems() {
32+
const items = new ItemList();
33+
34+
items.add('title', <h4 className="App-titleControl App-titleControl--text">{app.translator.trans('core.forum.notifications.title')}</h4>, 100);
35+
items.add('controls', <div className="App-primaryControl">{this.controlItems().toArray()}</div>, 90);
36+
37+
return items;
3038
}
3139

3240
controlItems() {

0 commit comments

Comments
 (0)