DEV: Add a context arg to after-topic-status outlet (#30940)

…so that plugins/themes can conditionally conditionally display their
topic-status icon (e.g. just on the topic list, or everywhere but the
header)
This commit is contained in:
Jarek Radosz 2025-01-23 04:21:31 +01:00 committed by GitHub
parent daab816a37
commit 474bfb5757
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 11 additions and 6 deletions

View File

@ -108,6 +108,7 @@ export default class Info extends Component {
<TopicStatus
@topic={{@topicInfo}}
@disableActions={{@disableActions}}
@context="header"
/>
<a

View File

@ -1,6 +1,10 @@
<span class="topic">
<span class="first-line">
<TopicStatus @topic={{@result.topic}} @disableActions={{true}} />
<TopicStatus
@topic={{@result.topic}}
@disableActions={{true}}
@context="topic-view-title"
/>
<span class="topic-title" data-topic-id={{@result.topic.id}}>
{{#if
(and

View File

@ -17,7 +17,7 @@ const onTimestampClick = function (event) {
const FeaturedTopic = <template>
<div data-topic-id={{@topic.id}} class="featured-topic --glimmer">
<TopicStatus @topic={{@topic}} />
<TopicStatus @topic={{@topic}} @context="topic-list" />
<a href={{@topic.lastUnreadUrl}} class="title">{{htmlSafe
@topic.fancyTitle

View File

@ -283,7 +283,7 @@ export default class Item extends Component {
@outletArgs={{hash topic=@topic}}
/>
{{~! no whitespace ~}}
<TopicStatus @topic={{@topic}} />
<TopicStatus @topic={{@topic}} @context="topic-list" />
{{~! no whitespace ~}}
<TopicLink
{{on "focus" this.onTitleFocus}}

View File

@ -67,7 +67,7 @@ export default class TopicCell extends Component {
@outletArgs={{hash topic=@topic tagsForUser=@tagsForUser}}
>
{{~! no whitespace ~}}
<TopicStatus @topic={{@topic}} />
<TopicStatus @topic={{@topic}} @context="topic-list" />
{{~! no whitespace ~}}
<TopicLink
{{on "focus" this.onTitleFocus}}

View File

@ -62,7 +62,7 @@ export default class LatestTopicListItem extends Component {
<div class="main-link">
<div class="top-row">
<TopicStatus @topic={{@topic}} />
<TopicStatus @topic={{@topic}} @context="topic-list" />
{{topicLink @topic}}
{{~#if @topic.featured_link}}

View File

@ -112,7 +112,7 @@ export default class TopicStatus extends Component {
{{~#if this.site.useGlimmerTopicList~}}
<PluginOutlet
@name="after-topic-status"
@outletArgs={{hash topic=@topic}}
@outletArgs={{hash topic=@topic context=@context}}
/>
{{~else~}}
{{~#each TopicStatusIcons.entries as |entry|~}}