DEV: Add class to solved topics in list (#159)

This commit is contained in:
Kris 2021-08-27 14:41:57 -04:00 committed by GitHub
parent f20274f44a
commit 6b6d5978a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
import discourseComputed from "discourse-common/utils/decorators";
import TopicListItem from "discourse/components/topic-list-item";
export default {
name: "add-topic-list-class",
initialize() {
TopicListItem.reopen({
@discourseComputed()
unboundClassNames() {
let classList = this._super(...arguments);
if (this.topic.has_accepted_answer) {
classList += " status-solved";
}
return classList;
},
});
},
};