mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Pull icon choosing into its own method
This commit is contained in:
parent
36d7abed0b
commit
02deaa4bc6
@ -118,16 +118,20 @@ export const DefaultNotificationItem =
|
|||||||
return I18n.t(scope, { description, username });
|
return I18n.t(scope, { description, username });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
icon(notificationName, data) {
|
||||||
|
let infoKey =
|
||||||
|
notificationName === "custom" ? data.message : notificationName;
|
||||||
|
return iconNode(`notification.${infoKey}`);
|
||||||
|
},
|
||||||
|
|
||||||
html(attrs) {
|
html(attrs) {
|
||||||
const notificationType = attrs.notification_type;
|
const notificationType = attrs.notification_type;
|
||||||
const lookup = this.site.get("notificationLookup");
|
const lookup = this.site.get("notificationLookup");
|
||||||
const notificationName = lookup[notificationType];
|
const notificationName = lookup[notificationType];
|
||||||
|
|
||||||
let { data } = attrs;
|
let { data } = attrs;
|
||||||
let infoKey =
|
|
||||||
notificationName === "custom" ? data.message : notificationName;
|
|
||||||
let text = emojiUnescape(this.text(notificationType, notificationName));
|
let text = emojiUnescape(this.text(notificationType, notificationName));
|
||||||
let icon = iconNode(`notification.${infoKey}`);
|
let icon = this.icon(notificationName, data);
|
||||||
|
|
||||||
let title;
|
let title;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user