1
0
mirror of https://github.com/flarum/core.git synced 2025-07-26 03:01:22 +02:00
Files
php-flarum/extensions/likes/js/src/forum/index.js
Sami Mazouz 47b670aa29 feat: frontend Model extender (#3646)
* feat: reintroduce frontend extenders
* chore: used `Routes` extender in bundled extensions
* chore: used `PostTypes` extender in bundled extensions
* chore: `yarn format`
* feat: `Model` frontend extender
* chore: naming
* chore(review): attributes can be nullable or undefined
* chore(review): delay extender implementation
* chore(review): unnecessary check
* chore(review): stay consistent
* chore: merge conflicts
* chore: unused import
* chore: multiline extenders
* feat: add Store extender

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-08 21:13:53 +01:00

27 lines
881 B
JavaScript

import { extend } from 'flarum/common/extend';
import app from 'flarum/forum/app';
import NotificationGrid from 'flarum/forum/components/NotificationGrid';
import addLikeAction from './addLikeAction';
import addLikesList from './addLikesList';
import PostLikedNotification from './components/PostLikedNotification';
import addLikesTabToUserProfile from './addLikesTabToUserProfile';
export { default as extend } from './extend';
app.initializers.add('flarum-likes', () => {
app.notificationComponents.postLiked = PostLikedNotification;
addLikeAction();
addLikesList();
addLikesTabToUserProfile();
extend(NotificationGrid.prototype, 'notificationTypes', function (items) {
items.add('postLiked', {
name: 'postLiked',
icon: 'far fa-thumbs-up',
label: app.translator.trans('flarum-likes.forum.settings.notify_post_liked_label'),
});
});
});