DEV: Add mainOutletModifierClasses for chat main outlet

The main outlet needs different styles based on the route,
and whether the sidebar is expanded.
This commit is contained in:
Martin Brennan 2023-02-10 15:09:20 +10:00
parent 218dbc249a
commit be8968b05b
2 changed files with 19 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import { inject as service } from "@ember/service";
export default class ChatController extends Controller {
@service chat;
@service chatStateManager;
@service router;
get shouldUseChatSidebar() {
if (this.site.mobileView) {
@ -20,4 +21,21 @@ export default class ChatController extends Controller {
get shouldUseCoreSidebar() {
return this.siteSettings.navigation_menu === "sidebar";
}
get mainOutletModifierClasses() {
let modifierClasses = [];
if (this.chatStateManager.isSidePanelExpanded) {
modifierClasses.push("has-side-panel-expanded");
}
if (
!this.router.currentRouteName.startsWith("chat.channel.info") &&
!this.router.currentRouteName.startsWith("chat.browse")
) {
modifierClasses.push("chat-blah");
}
return modifierClasses.join(" ");
}
}

View File

@ -21,7 +21,7 @@
id="main-chat-outlet"
class={{concat-class
"main-chat-outlet"
(if this.chatStateManager.isSidePanelExpanded "has-side-panel-expanded")
this.mainOutletModifierClasses
}}
>
{{outlet}}