Skip to content

Commit

Permalink
DEV: update component to be compatible with the Glimmer header
Browse files Browse the repository at this point in the history
  • Loading branch information
megothss committed May 22, 2024
1 parent 234579c commit 94e2e35
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
1 change: 1 addition & 0 deletions .discourse-compatibility
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
< 3.3.0.beta3-dev: 234579c89a96d2d70ba6e20aed9d52821d305c94
< 3.3.0.beta1-dev: 1ad74452d38f5449a46bd36b5cc93988a95c9a6c
3.1.999: d206e14b51cf7a72bc175963ad99c9572a18be5d
3.1.0.beta3: 8be5bef97767262d1a727773f6aafc0addab9b0c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { loadColorSchemeStylesheet } from "discourse/lib/color-scheme-picker";
import { withPluginApi } from "discourse/lib/plugin-api";
import { currentThemeId } from "discourse/lib/theme-selector";
import Session from "discourse/models/session";
import ColorSchemeToggler from "../components/color-scheme-toggler";
import {
COLOR_SCHEME_OVERRIDE_KEY,
colorSchemeOverride,
Expand Down Expand Up @@ -68,8 +69,18 @@ export default {
});

if (settings.add_color_scheme_toggle_to_header) {
withPluginApi("0.8", (api) => {
api.addToHeaderIcons("header-toggle-button");
withPluginApi("1.28.0", (api) => {
api.headerIcons.add(
"header-toggle-button",
<template>
<li class="header-toggle-button header-dropdown-toggle">
<span class="header-color-scheme-toggle icon">
<ColorSchemeToggler />
</span>
</li>
</template>,
{ before: "search" }
);
});
}
},
Expand Down
17 changes: 0 additions & 17 deletions javascripts/discourse/widgets/header-toggle-button.js

This file was deleted.

0 comments on commit 94e2e35

Please sign in to comment.