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:
parent
218dbc249a
commit
be8968b05b
@ -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(" ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user