-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV: Switch to new API to render into plugin outlet
Why this change? The `renderInOutlet` plugin API was introduced in Discourse core which we will prefer to use going forward.
- Loading branch information
Showing
6 changed files
with
29 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
3.1.999: e2cc21b33261ffeb32030e8ab5ea92775c911fbc | ||
< 3.2.0.beta1-dev: b36e2a5199db23e5f05374640b9690573a08b352 | ||
< 3.2.0.beta2-dev: 12e6f76e0508b262517efd5db2d7feca261dff86 | ||
2.6.0.beta3: 79d57c32d579d85590ef50344edf236cad52f9de |
21 changes: 21 additions & 0 deletions
21
javascripts/discourse/components/brand-header-container.gjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Component from "@glimmer/component"; | ||
import { inject as service } from "@ember/service"; | ||
import BrandHeaderContents from "./brand-header-contents"; | ||
import or from "truth-helpers/helpers/or"; | ||
import not from "truth-helpers/helpers/not"; | ||
|
||
export default class BrandHeaderContainer extends Component { | ||
@service site; | ||
|
||
<template> | ||
{{#if (or (not this.site.mobileView) settings.show_bar_on_mobile)}} | ||
<header class="b-header"> | ||
<div class="wrap"> | ||
<div class="contents"> | ||
<BrandHeaderContents /> | ||
</div> | ||
</div> | ||
</header> | ||
{{/if}} | ||
</template> | ||
} |
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
javascripts/discourse/connectors/above-site-header/brand-header.hbs
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
javascripts/discourse/connectors/above-site-header/brand-header.js
This file was deleted.
Oops, something went wrong.
8 changes: 7 additions & 1 deletion
8
...se/initializers/initialize-widget-shim.js → ...e/initializers/initialize-brand-header.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import { withPluginApi } from "discourse/lib/plugin-api"; | ||
import { registerWidgetShim } from "discourse/widgets/render-glimmer"; | ||
import { hbs } from "ember-cli-htmlbars"; | ||
import BrandHeaderContainer from "../components/brand-header-container"; | ||
|
||
export default { | ||
name: "brand-header-widgetized", | ||
name: "brand-header", | ||
|
||
initialize() { | ||
registerWidgetShim( | ||
"brand-header-widgetized", | ||
"div.brand-header-widgetized", | ||
hbs`<BrandHeaderContents />` | ||
); | ||
|
||
withPluginApi("1.14.0", (api) => { | ||
api.renderInOutlet("above-site-header", BrandHeaderContainer); | ||
}); | ||
}, | ||
}; |