Files
discourse_theme_ran/javascripts/discourse/components/card/topic-status-column.gjs
T
chapoi 6d8415579e UX: fix topic cards layout for messages with has-replies class (#183)
The `grid-template-areas` were not correct on the messages page

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Martin Brennan <martin@discourse.org>
2025-06-18 13:34:26 +10:00

39 lines
867 B
Plaintext

import Component from "@glimmer/component";
import { service } from "@ember/service";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class TopicStatusColumn extends Component {
@service siteSettings;
get badge() {
if (this.args.topic.is_hot) {
return {
icon: "fire",
text: "topic_hot",
className: "--hot",
};
}
if (this.args.topic.pinned) {
return {
icon: "thumbtack",
text: "topic_pinned",
className: "--pinned",
};
}
return null;
}
<template>
{{#if this.badge}}
<span class="topic-status-card {{this.badge.className}}">{{icon
this.badge.icon
}}<p class="topic-status-card__name">{{i18n
(themePrefix this.badge.text)
}}</p></span>
{{/if}}
</template>
}