mirror of
https://github.com/flarum/core.git
synced 2025-08-08 01:16:52 +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() {
|
view(): Mithril.Children {
|
||||||
return (
|
return <div className="DiscussionPage">{this.viewItems().toArray()}</div>;
|
||||||
<div className="DiscussionPage">
|
}
|
||||||
<DiscussionListPane state={app.discussions} />
|
|
||||||
<div className="DiscussionPage-discussion">{this.discussion ? this.pageContent().toArray() : this.loadingItems().toArray()}</div>
|
viewItems(): ItemList<Mithril.Children> {
|
||||||
</div>
|
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