@@ -6,7 +6,7 @@ import didInsert from "@ember/render-modifiers/modifiers/did-insert";
66import { next } from " @ember/runloop" ;
77import { service } from " @ember/service" ;
88import { modifier } from " ember-modifier" ;
9- import { eq } from " truth-helpers" ;
9+ import { eq , not } from " truth-helpers" ;
1010import PluginOutlet from " discourse/components/plugin-outlet" ;
1111import PostCountOrBadges from " discourse/components/topic-list/post-count-or-badges" ;
1212import TopicExcerpt from " discourse/components/topic-list/topic-excerpt" ;
@@ -185,6 +185,18 @@ export default class Item extends Component {
185185 }
186186 }
187187
188+ get useMobileLayout () {
189+ return applyValueTransformer (
190+ " topic-list-item-mobile-layout" ,
191+ this .site .mobileView ,
192+ { topic: this .args .topic }
193+ );
194+ }
195+
196+ get useDesktopLayout () {
197+ return ! this .useMobileLayout ;
198+ }
199+
188200 <template >
189201 <tr
190202 {{! template-lint-disable no-invalid-interactive }}
@@ -210,15 +222,15 @@ export default class Item extends Component {
210222 ( if @ topic.closed " closed" )
211223 this . tagClassNames
212224 ( applyValueTransformer
213- " topic-list-item-class" ( array ) ( hash topic =@ topic)
225+ " topic-list-item-class" ( array ) ( hash topic =@ topic index = @ index )
214226 )
215227 }}
216228 >
217229 <PluginOutlet
218230 @ name =" above-topic-list-item"
219231 @ outletArgs ={{hash topic =@ topic}}
220232 />
221- {{#if this . site.desktopView }}
233+ {{#if this . useDesktopLayout }}
222234 {{#each @ columns as | entry | }}
223235 <entry.value.item
224236 @ topic ={{@ topic }}
0 commit comments