From b0a3017871fafc687734e0442996d00f70384d9f Mon Sep 17 00:00:00 2001 From: Kris Date: Mon, 9 Dec 2024 17:20:45 -0500 Subject: [PATCH] DEV: add transformers to navigation bar for theme dev (#30190) --- .../app/components/navigation-bar.gjs | 19 +++++++++++++++++-- .../discourse/app/lib/transformer/registry.js | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/navigation-bar.gjs b/app/assets/javascripts/discourse/app/components/navigation-bar.gjs index 0e46c0888fa..894ef8a568a 100644 --- a/app/assets/javascripts/discourse/app/components/navigation-bar.gjs +++ b/app/assets/javascripts/discourse/app/components/navigation-bar.gjs @@ -7,6 +7,7 @@ import DropdownMenu from "discourse/components/dropdown-menu"; import NavigationItem from "discourse/components/navigation-item"; import PluginOutlet from "discourse/components/plugin-outlet"; import { filterTypeForMode } from "discourse/lib/filter-mode"; +import { applyValueTransformer } from "discourse/lib/transformer"; import icon from "discourse-common/helpers/d-icon"; import DMenu from "float-kit/components/d-menu"; @@ -26,6 +27,20 @@ export default class NavigationBarComponent extends Component { return item || navItems[0]; } + get showDropdown() { + return applyValueTransformer( + "navigation-bar-dropdown-mode", + this.site.mobileView + ); + } + + get navigationBarIcon() { + return applyValueTransformer( + "navigation-bar-dropdown-icon", + "discourse-chevron-expand" + ); + } + @action onRegisterApi(api) { this.dMenu = api; @@ -33,7 +48,7 @@ export default class NavigationBarComponent extends Component {