mirror of
https://github.com/flarum/core.git
synced 2025-08-23 08:33:45 +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/mentions/js/src/forum/extend.ts
Normal file
4
extensions/mentions/js/src/forum/extend.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import Extend from 'flarum/common/extenders';
|
||||
import MentionsUserPage from './components/MentionsUserPage';
|
||||
|
||||
export default [new Extend.Routes().add('user.mentions', '/u/:username/mentions', MentionsUserPage)];
|
@@ -13,10 +13,11 @@ import UserMentionedNotification from './components/UserMentionedNotification';
|
||||
import GroupMentionedNotification from './components/GroupMentionedNotification';
|
||||
import UserPage from 'flarum/forum/components/UserPage';
|
||||
import LinkButton from 'flarum/common/components/LinkButton';
|
||||
import MentionsUserPage from './components/MentionsUserPage';
|
||||
import User from 'flarum/common/models/User';
|
||||
import Model from 'flarum/common/Model';
|
||||
|
||||
export { default as extend } from './extend';
|
||||
|
||||
app.initializers.add('flarum-mentions', function () {
|
||||
User.prototype.canMentionGroups = Model.attribute('canMentionGroups');
|
||||
|
||||
@@ -65,7 +66,6 @@ app.initializers.add('flarum-mentions', function () {
|
||||
});
|
||||
|
||||
// Add mentions tab in user profile
|
||||
app.routes['user.mentions'] = { path: '/u/:username/mentions', component: MentionsUserPage };
|
||||
extend(UserPage.prototype, 'navItems', function (items) {
|
||||
const user = this.user;
|
||||
items.add(
|
||||
|
Reference in New Issue
Block a user