UX: displays reads/likes in the same order that post menu buttons (#8140)

This commit is contained in:
Joffrey JAFFEUX 2019-10-02 13:00:47 -04:00 committed by GitHub
parent ceb29d3eea
commit d0390fba3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -525,6 +525,19 @@ export default createWidget("post-menu", {
)
];
if (state.readers.length) {
const remaining = state.totalReaders - state.readers.length;
contents.push(
this.attach("small-user-list", {
users: state.readers,
addSelf: false,
listClassName: "who-read",
description: "post.actions.people.read",
count: remaining
})
);
}
if (state.likedUsers.length) {
const remaining = state.total - state.likedUsers.length;
contents.push(
@ -541,19 +554,6 @@ export default createWidget("post-menu", {
);
}
if (state.readers.length) {
const remaining = state.totalReaders - state.readers.length;
contents.push(
this.attach("small-user-list", {
users: state.readers,
addSelf: false,
listClassName: "who-read",
description: "post.actions.people.read",
count: remaining
})
);
}
return contents;
},