Skip to content

Commit 444f684

Browse files
authored
Merge pull request #993 from Juanuwu/master
Highlight which users are blocked in following/followers list
2 parents b0093f3 + 5eadad1 commit 444f684

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

_locales/en/messages.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -646,5 +646,6 @@
646646
"suspended_user": { "message": "Account suspended" },
647647
"suspended_user_desc": { "message": "The profile you are trying to view has been suspended." },
648648
"show_boring_indicators": { "message": "Show indicator in followers/following page if last tweet of person is a retweet/quote/non-existent/old" },
649-
"hide_original_languages":{"message": "Hide original languages when translated" }
649+
"hide_original_languages":{"message": "Hide original languages when translated" },
650+
"blocked": { "message": "Blocked" }
650651
}

layouts/header/style.css

+5
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,11 @@ emoji-picker {
19221922
bottom: 52px;
19231923
height: 40px
19241924
}
1925+
.user-item-btn.blocked
1926+
{
1927+
background-color: red;
1928+
border: 1px solid darkred;
1929+
}
19251930

19261931
.user-item-text {
19271932
width: fit-content;

scripts/helpers.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -1526,8 +1526,21 @@ async function appendUser(u, container, label, usernameClass = '') {
15261526
</a>
15271527
</div>
15281528
<div${u.id_str === user.id_str ? ' hidden' : ''}>
1529-
<button class="user-item-btn nice-button ${u.following ? 'following' : 'follow'}">${u.following ? LOC.following_btn.message : LOC.follow.message}</button>
1530-
</div>
1529+
<button class="user-item-btn nice-button ${
1530+
u.blocking
1531+
? 'blocked'
1532+
: u.following
1533+
? 'following'
1534+
: 'follow'
1535+
}">
1536+
${u.blocking
1537+
? LOC.blocked.message
1538+
: u.following
1539+
? LOC.following_btn.message
1540+
: LOC.follow.message
1541+
}
1542+
</button>
1543+
</div>
15311544
`;
15321545

15331546
let followButton = userElement.querySelector('.user-item-btn');

0 commit comments

Comments
 (0)