Skip to content

Commit

Permalink
recommendation notifications support
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Jul 25, 2022
1 parent 16fcf8f commit 744af2b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion layouts/notifications/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -825,13 +825,18 @@ async function renderNotifications(data, append = false) {
matches++;
});
};
let users = n.template.aggregateUserActionsV1.fromUsers.map(u => data.globalObjects.users[u.user.id]);

if(n.icon.id === 'recommendation_icon') {
notificationHeader = `<b><a href="https://twitter.com/${users[0].screen_name}">${escapeHTML(notificationHeader)}</a></b> tweeted something you might like`;
}

let iconClasses = {
'heart_icon': 'ni-favorite',
'person_icon': 'ni-follow',
'retweet_icon': 'ni-retweet',
'recommendation_icon': 'ni-recommend'
};
let users = n.template.aggregateUserActionsV1.fromUsers.map(u => data.globalObjects.users[u.user.id]);
notificationDiv.innerHTML = /*html*/`
<div class="notification-icon ${iconClasses[n.icon.id]}"></div>
<div class="notification-header">
Expand Down
4 changes: 4 additions & 0 deletions layouts/notifications/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,10 @@ a:hover,
color: #5c913b;
content: "\f006"
}
.ni-recommend:before {
color: #ca4e4e;
content: "\f011"
}

.notification-avatar {
display: inline-block;
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Old Twitter Layout (2022)",
"description": "A new extension that returns old Twitter's look.",
"version": "1.2.4",
"version": "1.2.5",
"manifest_version": 3,
"homepage_url": "https://github.com/dimdenGD/OldTwitter",
"background": {
Expand Down

0 comments on commit 744af2b

Please sign in to comment.