mirror of
https://github.com/flarum/core.git
synced 2025-08-11 02:44:04 +02:00
feat: introduce frontend extenders (#3645)
* feat: reintroduce frontend extenders * chore: used `Routes` extender in bundled extensions * chore: used `PostTypes` extender in bundled extensions * chore: `yarn format` * chore: naming * chore(review): unnecessary check * chore(review): stay consistent * chore: unused import Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
4
extensions/subscriptions/js/src/forum/extend.ts
Normal file
4
extensions/subscriptions/js/src/forum/extend.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import Extend from 'flarum/common/extenders';
|
||||
import IndexPage from 'flarum/forum/components/IndexPage';
|
||||
|
||||
export default [new Extend.Routes().add('following', '/following', IndexPage)];
|
@@ -2,7 +2,6 @@ import { extend } from 'flarum/common/extend';
|
||||
import app from 'flarum/forum/app';
|
||||
import Model from 'flarum/common/Model';
|
||||
import Discussion from 'flarum/common/models/Discussion';
|
||||
import IndexPage from 'flarum/forum/components/IndexPage';
|
||||
import NotificationGrid from 'flarum/forum/components/NotificationGrid';
|
||||
|
||||
import addSubscriptionBadge from './addSubscriptionBadge';
|
||||
@@ -12,8 +11,9 @@ import addSubscriptionSettings from './addSubscriptionSettings';
|
||||
|
||||
import NewPostNotification from './components/NewPostNotification';
|
||||
|
||||
export { default as extend } from './extend';
|
||||
|
||||
app.initializers.add('subscriptions', function () {
|
||||
app.routes.following = { path: '/following', component: IndexPage };
|
||||
app.notificationComponents.newPost = NewPostNotification;
|
||||
|
||||
Discussion.prototype.subscription = Model.attribute('subscription');
|
||||
|
Reference in New Issue
Block a user