1
0
mirror of https://github.com/flarum/core.git synced 2025-07-15 22:06:24 +02:00
Files
php-flarum/extensions/likes/js/src/forum/components/PostLikedNotification.js
Ian Morland 542fac888d chore: repo maintenance (#30)
* Bump deps

* Update imports

* Format
2022-01-11 10:40:45 +00:00

25 lines
661 B
JavaScript

import app from 'flarum/forum/app';
import Notification from 'flarum/forum/components/Notification';
import { truncate } from 'flarum/common/utils/string';
export default class PostLikedNotification extends Notification {
icon() {
return 'far fa-thumbs-up';
}
href() {
return app.route.post(this.attrs.notification.subject());
}
content() {
const notification = this.attrs.notification;
const user = notification.fromUser();
return app.translator.trans('flarum-likes.forum.notifications.post_liked_text', { user, count: 1 });
}
excerpt() {
return truncate(this.attrs.notification.subject().contentPlain(), 200);
}
}