mirror of
https://github.com/flarum/core.git
synced 2025-07-29 04:30:56 +02:00
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
import Notification from 'flarum/components/Notification';
|
|
import username from 'flarum/helpers/username';
|
|
import punctuateSeries from 'flarum/helpers/punctuateSeries';
|
|
|
|
export default class PostMentionedNotification extends Notification {
|
|
icon() {
|
|
return 'fas fa-reply';
|
|
}
|
|
|
|
href() {
|
|
const notification = this.props.notification;
|
|
const post = notification.subject();
|
|
const auc = notification.additionalUnreadCount();
|
|
const content = notification.content();
|
|
|
|
return app.route.discussion(post.discussion(), auc ? post.number() : (content && content.replyNumber));
|
|
}
|
|
|
|
content() {
|
|
const notification = this.props.notification;
|
|
const auc = notification.additionalUnreadCount();
|
|
const user = notification.sender();
|
|
|
|
return app.translator.transChoice('flarum-mentions.forum.notifications.post_mentioned_text', auc + 1, {
|
|
user,
|
|
username: auc ? punctuateSeries([
|
|
username(user),
|
|
app.translator.transChoice('flarum-mentions.forum.notifications.others_text', auc, {count: auc})
|
|
]) : undefined
|
|
});
|
|
}
|
|
|
|
excerpt() {
|
|
return this.props.notification.subject().contentPlain();
|
|
}
|
|
}
|