UX: Hide all header and footer content on chat routes

This commit is contained in:
David Taylor 2024-11-14 16:23:53 +00:00
parent 9b691853e0
commit 1dc4d6c9d5
5 changed files with 43 additions and 24 deletions

View File

@ -2,6 +2,7 @@ import Controller from "@ember/controller";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { service } from "@ember/service"; import { service } from "@ember/service";
import runAfterFramePaint from "discourse/lib/after-frame-paint"; import runAfterFramePaint from "discourse/lib/after-frame-paint";
import { applyValueTransformer } from "discourse/lib/transformer";
import { isTesting } from "discourse-common/config/environment"; import { isTesting } from "discourse-common/config/environment";
import discourseDebounce from "discourse-common/lib/debounce"; import discourseDebounce from "discourse-common/lib/debounce";
import deprecated from "discourse-common/lib/deprecated"; import deprecated from "discourse-common/lib/deprecated";
@ -39,6 +40,10 @@ export default class ApplicationController extends Controller {
return this.showFooter && this.siteSettings.enable_powered_by_discourse; return this.showFooter && this.siteSettings.enable_powered_by_discourse;
} }
get showBannerContent() {
return applyValueTransformer("show-application-banner-content", true);
}
@discourseComputed @discourseComputed
canSignUp() { canSignUp() {
return ( return (

View File

@ -13,4 +13,5 @@ export const VALUE_TRANSFORMERS = Object.freeze([
"mentions-class", "mentions-class",
"more-topics-tabs", "more-topics-tabs",
"post-menu-buttons", "post-menu-buttons",
"show-application-banner-content",
]); ]);

View File

@ -47,11 +47,16 @@
<LoadingSliderFallbackSpinner /> <LoadingSliderFallbackSpinner />
{{#if this.showBannerContent}}
<PluginOutlet @name="before-main-outlet" /> <PluginOutlet @name="before-main-outlet" />
{{/if}}
<div id="main-outlet"> <div id="main-outlet">
{{#if this.showBannerContent}}
<PluginOutlet @name="above-main-container" @connectorTagName="div" /> <PluginOutlet @name="above-main-container" @connectorTagName="div" />
{{/if}}
<div class="container" id="main-container"> <div class="container" id="main-container">
{{#if this.showBannerContent}}
{{#if this.showTop}} {{#if this.showTop}}
<CustomHtml @name="top" /> <CustomHtml @name="top" />
{{/if}} {{/if}}
@ -63,18 +68,23 @@
@connectorTagName="div" @connectorTagName="div"
@outletArgs={{hash currentPath=this.router._router.currentPath}} @outletArgs={{hash currentPath=this.router._router.currentPath}}
/> />
{{/if}}
</div> </div>
{{outlet}} {{outlet}}
<CardContainer /> <CardContainer />
{{#if this.showBannerContent}}
<PluginOutlet <PluginOutlet
@name="main-outlet-bottom" @name="main-outlet-bottom"
@outletArgs={{hash showFooter=this.showFooter}} @outletArgs={{hash showFooter=this.showFooter}}
/> />
{{/if}}
</div> </div>
{{#if this.showBannerContent}}
<PluginOutlet @name="after-main-outlet" /> <PluginOutlet @name="after-main-outlet" />
{{/if}}
{{#if this.showPoweredBy}} {{#if this.showPoweredBy}}
<PoweredByDiscourse /> <PoweredByDiscourse />

View File

@ -172,6 +172,16 @@ class ChatSetupInit {
category: "organisms", category: "organisms",
id: "chat", id: "chat",
}); });
api.registerValueTransformer(
"show-application-banner-content",
({ value }) => {
if (this.router.currentRouteName.startsWith("chat.")) {
return false;
}
return value;
}
);
}); });
} }

View File

@ -1,10 +1,3 @@
.has-full-page-chat {
.global-notice,
.bootstrap-mode-notice {
display: none;
}
}
.admin-plugins { .admin-plugins {
[data-plugin-name="chat"] { [data-plugin-name="chat"] {
display: none; display: none;