mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
[1.x] [extensibility] refactor(core): improve extensibility of DiscussionPage
(#4046)
* refactor(core): improve extensibility of `DiscussionPage` * chore(core): improve type safety
This commit is contained in:
@@ -79,13 +79,21 @@ export default class DiscussionPage<CustomAttrs extends IDiscussionPageAttrs = I
|
||||
}
|
||||
}
|
||||
|
||||
view() {
|
||||
return (
|
||||
<div className="DiscussionPage">
|
||||
<DiscussionListPane state={app.discussions} />
|
||||
<div className="DiscussionPage-discussion">{this.discussion ? this.pageContent().toArray() : this.loadingItems().toArray()}</div>
|
||||
</div>
|
||||
view(): Mithril.Children {
|
||||
return <div className="DiscussionPage">{this.viewItems().toArray()}</div>;
|
||||
}
|
||||
|
||||
viewItems(): ItemList<Mithril.Children> {
|
||||
const items = new ItemList<Mithril.Children>();
|
||||
|
||||
items.add('pane', <DiscussionListPane state={app.discussions} />, 100);
|
||||
items.add(
|
||||
'discussions',
|
||||
<div className="DiscussionPage-discussion">{this.discussion ? this.pageContent().toArray() : this.loadingItems().toArray()}</div>,
|
||||
90
|
||||
);
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user