1
0
mirror of https://github.com/flarum/core.git synced 2025-07-26 11:10:41 +02:00
Files
php-flarum/extensions/suspend/js/src/forum/components/UserSuspendedNotification.js
Alexander Skvortsov b26a9af51f Mithril 2 Update (#27)
Update for Mithril 2
2020-09-23 22:57:08 -04:00

23 lines
618 B
JavaScript

import Notification from 'flarum/components/Notification';
export default class UserSuspendedNotification extends Notification {
icon() {
return 'fas fa-ban';
}
href() {
return app.route.user(this.attrs.notification.subject());
}
content() {
const notification = this.attrs.notification;
const suspendedUntil = notification.content();
const timeReadable = dayjs(suspendedUntil.date).from(notification.createdAt(), true);
return app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {
user: notification.fromUser(),
timeReadable,
});
}
}