mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 11:02:46 +08:00
DEV: migrates private-message-glyph to gjs (#27858)
This commit is contained in:
parent
d5dd5bfb55
commit
478b096286
|
@ -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;
|
|
@ -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}}
|
|
@ -1,9 +0,0 @@
|
|||
import Component from "@ember/component";
|
||||
|
||||
export default Component.extend({
|
||||
tagName: null,
|
||||
href: null,
|
||||
title: null,
|
||||
ariaLabel: null,
|
||||
shouldShow: null,
|
||||
});
|
|
@ -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}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user