New API for replacing an icon

This commit is contained in:
Robin Ward
2017-09-15 13:54:47 -04:00
parent ad77634854
commit e4e27a4b83
3 changed files with 22 additions and 4 deletions
@@ -99,8 +99,11 @@ createWidget('notification-item', {
const lookup = this.site.get('notificationLookup');
const notName = lookup[notificationType];
let title = I18n.t(`notifications.alt.${notName}`);
let icon = iconNode(`notification.${notName}`, { title });
let { data } = attrs;
let infoKey = notName === 'custom' ? data.message : notName;
let title = I18n.t(`notifications.alt.${infoKey}`);
let icon = iconNode(`notification.${infoKey}`, { title });
let text = emojiUnescape(this.text(notificationType, notName));
// We can use a `<p>` tag here once other languages have fixed their HTML