diff --git a/javascripts/discourse/components/card/topic-activity-column.gjs b/javascripts/discourse/components/card/topic-activity-column.gjs index ac894b2..6ccd498 100644 --- a/javascripts/discourse/components/card/topic-activity-column.gjs +++ b/javascripts/discourse/components/card/topic-activity-column.gjs @@ -1,42 +1,56 @@ import Component from "@glimmer/component"; import avatar from "discourse/helpers/avatar"; +import concatClass from "discourse/helpers/concat-class"; +import icon from "discourse/helpers/d-icon"; import formatDate from "discourse/helpers/format-date"; import { i18n } from "discourse-i18n"; -import gt from "truth-helpers/helpers/gt"; export default class TopicActivityColumn extends Component { - get activityText() { - // this should handle any case where a topic was no bumped due to a reply/post + get topicUser() { if ( moment(this.args.topic.bumped_at).isAfter(this.args.topic.last_posted_at) ) { - return "user_updated"; + return { + user: undefined, + username: undefined, + activityText: "user_updated", + class: "--updated", + }; } if (this.args.topic.posts_count > 1) { - return "user_replied"; + return { + user: this.args.topic.lastPosterUser, + username: this.args.topic.last_poster_username, + activityText: "user_replied", + class: "--replied", + }; } else if (this.args.topic.posts_count === 1) { - return "user_posted"; + return { + user: this.args.topic.creator, + username: this.args.topic.creator.username, + activityText: "user_posted", + class: "--posted", + }; } }