mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
This change adds a wrapper link around the thread list details on mobile to make the click area larger. We also update child div elements to span to ensure valid html, since the link is an inline element and divs are block level. --------- Co-authored-by: chapoi <[email protected]>
42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
import Component from "@glimmer/component";
|
|
import { LinkTo } from "@ember/routing";
|
|
import { service } from "@ember/service";
|
|
import { htmlSafe } from "@ember/template";
|
|
import replaceEmoji from "discourse/helpers/replace-emoji";
|
|
import { escapeExpression } from "discourse/lib/utilities";
|
|
import ThreadUnreadIndicator from "discourse/plugins/chat/discourse/components/thread-unread-indicator";
|
|
|
|
export default class ChatThreadTitle extends Component {
|
|
@service site;
|
|
|
|
get title() {
|
|
if (this.args.thread.title) {
|
|
return replaceEmoji(htmlSafe(escapeExpression(this.args.thread.title)));
|
|
} else {
|
|
return replaceEmoji(htmlSafe(this.args.thread.originalMessage.excerpt));
|
|
}
|
|
}
|
|
|
|
<template>
|
|
<span class="chat__thread-title-container">
|
|
<span class="chat__thread-title">
|
|
{{#if this.site.desktopView}}
|
|
<LinkTo
|
|
class="chat__thread-title__name"
|
|
@route="chat.channel.thread"
|
|
@models={{@thread.routeModels}}
|
|
>
|
|
{{this.title}}
|
|
</LinkTo>
|
|
{{else}}
|
|
<span class="chat__thread-title__name">
|
|
{{this.title}}
|
|
</span>
|
|
{{/if}}
|
|
|
|
</span>
|
|
<ThreadUnreadIndicator @thread={{@thread}} />
|
|
</span>
|
|
</template>
|
|
}
|