From 8a13667a8a6745620824d288a351cf4b2f92b811 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 7 Mar 2024 19:45:48 +0000 Subject: [PATCH] DEV: Introduce second home-logo wrapper plugin outlet (#26080) The `home-logo-wrapper` outlet is used by chat, which means it is unavailable for use by any other themes/plugins. This commit introduces a second nested outlet called `home-logo` which can be used to replace the logo without affecting chat's header logic. --- .../components/glimmer-header/home-logo.gjs | 61 ++++++++++--------- .../app/widgets/home-logo-wrapper-outlet.js | 6 +- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/glimmer-header/home-logo.gjs b/app/assets/javascripts/discourse/app/components/glimmer-header/home-logo.gjs index 9036beabc17..4031e68ac74 100644 --- a/app/assets/javascripts/discourse/app/components/glimmer-header/home-logo.gjs +++ b/app/assets/javascripts/discourse/app/components/glimmer-header/home-logo.gjs @@ -2,6 +2,7 @@ import Component from "@glimmer/component"; import { on } from "@ember/modifier"; import { action } from "@ember/object"; import { service } from "@ember/service"; +import PluginOutlet from "discourse/components/plugin-outlet"; import concatClass from "discourse/helpers/concat-class"; import { wantsNewWindow } from "discourse/lib/intercept-click"; import DiscourseURL from "discourse/lib/url"; @@ -76,39 +77,41 @@ export default class HomeLogo extends Component { } } diff --git a/app/assets/javascripts/discourse/app/widgets/home-logo-wrapper-outlet.js b/app/assets/javascripts/discourse/app/widgets/home-logo-wrapper-outlet.js index cc0748b59f2..8306ce8e18a 100644 --- a/app/assets/javascripts/discourse/app/widgets/home-logo-wrapper-outlet.js +++ b/app/assets/javascripts/discourse/app/widgets/home-logo-wrapper-outlet.js @@ -4,5 +4,9 @@ import { registerWidgetShim } from "discourse/widgets/render-glimmer"; registerWidgetShim( "home-logo-wrapper-outlet", "div.home-logo-wrapper-outlet", - hbs`` + hbs` + + + + ` );