DEV: migrates private-message-glyph to gjs (#27858)

This commit is contained in:
Joffrey JAFFEUX 2024-07-11 11:53:24 +02:00 committed by GitHub
parent d5dd5bfb55
commit 478b096286
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 32 deletions

View File

@ -0,0 +1,20 @@
import icon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
const PrivateMessageGlyph = <template>
{{#if @shouldShow}}
{{#if @href}}
<a href={{@href}} title={{i18n @title}} aria-label={{i18n @ariaLabel}}>
<span class="private-message-glyph-wrapper">
{{icon "envelope" class="private-message-glyph"}}
</span>
</a>
{{~else}}
<span class="private-message-glyph-wrapper">
{{icon "envelope" class="private-message-glyph"}}
</span>
{{~/if}}
{{/if}}
</template>;
export default PrivateMessageGlyph;

View File

@ -1,17 +0,0 @@
{{#if this.shouldShow}}
{{#if this.href}}
<a
href={{this.href}}
title={{i18n this.title}}
aria-label={{i18n this.ariaLabel}}
>
<span class="private-message-glyph-wrapper">
{{d-icon "envelope" class="private-message-glyph"}}
</span>
</a>
{{~else}}
<span class="private-message-glyph-wrapper">
{{d-icon "envelope" class="private-message-glyph"}}
</span>
{{~/if}}
{{/if}}

View File

@ -1,9 +0,0 @@
import Component from "@ember/component";
export default Component.extend({
tagName: null,
href: null,
title: null,
ariaLabel: null,
shouldShow: null,
});

View File

@ -50,10 +50,7 @@
>
{{#if this.editingTopic}}
<div class="edit-topic-title">
<PrivateMessageGlyph
@shouldShow={{this.model.isPrivateMessage}}
@tagName=""
/>
<PrivateMessageGlyph @shouldShow={{this.model.isPrivateMessage}} />
<TextField
@id="edit-title"
@ -129,12 +126,10 @@
@href={{this.pmPath}}
@title="topic_statuses.personal_message.title"
@ariaLabel="user.messages.inbox"
@tagName=""
/>
{{else}}
<PrivateMessageGlyph
@shouldShow={{this.model.isPrivateMessage}}
@tagName=""
/>
{{/if}}
{{/unless}}