DEV: Minor cleanup of navbar components (#25222)
Convert components to template-only where applicable.
This commit is contained in:
parent
c2aa64b251
commit
3a0bf97401
|
@ -1,4 +1,3 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { hash } from "@ember/helper";
|
||||
import CloseDrawerButton from "./close-drawer-button";
|
||||
import CloseThreadButton from "./close-thread-button";
|
||||
|
@ -11,8 +10,7 @@ import ThreadTrackingDropdown from "./thread-tracking-dropdown";
|
|||
import ThreadsListButton from "./threads-list-button";
|
||||
import ToggleDrawerButton from "./toggle-drawer-button";
|
||||
|
||||
export default class ChatNavbarActions extends Component {
|
||||
<template>
|
||||
const ChatNavbarActions = <template>
|
||||
<nav class="c-navbar__actions">
|
||||
{{yield
|
||||
(hash
|
||||
|
@ -29,5 +27,6 @@ export default class ChatNavbarActions extends Component {
|
|||
)
|
||||
}}
|
||||
</nav>
|
||||
</template>
|
||||
}
|
||||
</template>;
|
||||
|
||||
export default ChatNavbarActions;
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { LinkTo } from "@ember/routing";
|
||||
import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";
|
||||
|
||||
export default class ChatNavbarChannelTitle extends Component {
|
||||
<template>
|
||||
const ChatNavbarChannelTitle = <template>
|
||||
{{#if @channel}}
|
||||
<LinkTo
|
||||
@route="chat.channel.info.members"
|
||||
|
@ -13,5 +11,6 @@ export default class ChatNavbarChannelTitle extends Component {
|
|||
<ChannelTitle @channel={{@channel}} />
|
||||
</LinkTo>
|
||||
{{/if}}
|
||||
</template>
|
||||
}
|
||||
</template>;
|
||||
|
||||
export default ChatNavbarChannelTitle;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { hash } from "@ember/helper";
|
||||
import { on } from "@ember/modifier";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
|
@ -8,8 +7,7 @@ import BackButton from "./back-button";
|
|||
import ChannelTitle from "./channel-title";
|
||||
import Title from "./title";
|
||||
|
||||
export default class ChatNavbar extends Component {
|
||||
<template>
|
||||
const ChatNavbar = <template>
|
||||
{{! template-lint-disable no-invalid-interactive }}
|
||||
<div
|
||||
class={{concatClass "c-navbar-container" (if @onClick "-clickable")}}
|
||||
|
@ -26,5 +24,6 @@ export default class ChatNavbar extends Component {
|
|||
}}
|
||||
</nav>
|
||||
</div>
|
||||
</template>
|
||||
}
|
||||
</template>;
|
||||
|
||||
export default ChatNavbar;
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
import Component from "@glimmer/component";
|
||||
|
||||
export default class ChatNavbarSubTitle extends Component {
|
||||
<template>
|
||||
const ChatNavbarSubTitle = <template>
|
||||
<div class="c-navbar__sub-title">
|
||||
{{#if (has-block)}}
|
||||
{{yield}}
|
||||
|
@ -9,5 +6,6 @@ export default class ChatNavbarSubTitle extends Component {
|
|||
{{@title}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
}
|
||||
</template>;
|
||||
|
||||
export default ChatNavbarSubTitle;
|
||||
|
|
|
@ -1,23 +1,18 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { hash } from "@ember/helper";
|
||||
import icon from "discourse-common/helpers/d-icon";
|
||||
import SubTitle from "./sub-title";
|
||||
|
||||
export default class ChatNavbarTitle extends Component {
|
||||
<template>
|
||||
const ChatNavbarTitle = <template>
|
||||
<div title={{@title}} class="c-navbar__title">
|
||||
{{#if (has-block)}}
|
||||
{{#if @icon}}
|
||||
{{icon @icon}}
|
||||
{{/if}}
|
||||
{{if @icon (icon @icon)}}
|
||||
{{@title}}
|
||||
{{yield (hash SubTitle=SubTitle)}}
|
||||
{{else}}
|
||||
{{#if @icon}}
|
||||
{{icon @icon}}
|
||||
{{/if}}
|
||||
{{if @icon (icon @icon)}}
|
||||
{{@title}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
}
|
||||
</template>;
|
||||
|
||||
export default ChatNavbarTitle;
|
||||
|
|
Loading…
Reference in New Issue