diff --git a/app/assets/javascripts/discourse/app/components/d-navigation-item.hbs b/app/assets/javascripts/discourse/app/components/d-navigation-item.hbs
index d3fc03d783d..66b1018c4fb 100644
--- a/app/assets/javascripts/discourse/app/components/d-navigation-item.hbs
+++ b/app/assets/javascripts/discourse/app/components/d-navigation-item.hbs
@@ -1,3 +1,10 @@
-
- {{yield}}
-
\ No newline at end of file
+
+
+ {{yield}}
+
+
\ No newline at end of file
diff --git a/app/assets/javascripts/discourse/app/components/d-navigation-item.js b/app/assets/javascripts/discourse/app/components/d-navigation-item.js
index ec9e17dd22b..3aee34f7a31 100644
--- a/app/assets/javascripts/discourse/app/components/d-navigation-item.js
+++ b/app/assets/javascripts/discourse/app/components/d-navigation-item.js
@@ -1,41 +1,29 @@
-import Component from "@ember/component";
-import { computed } from "@ember/object";
+import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
-export default Component.extend({
- tagName: "li",
+export default class DNavigationItem extends Component {
+ @service router;
- route: null,
-
- router: service(),
-
- attributeBindings: ["ariaCurrent:aria-current", "title"],
-
- ariaCurrent: computed(
- "router.currentRouteName",
- "router.currentRoute.parent.name",
- "route",
- "ariaCurrentContext",
- function () {
- let ariaCurrentValue = "page";
-
- // when there are multiple levels of navigation
- // we want the active parent to get `aria-current="page"`
- // and the active child to get `aria-current="location"`
- if (this.ariaCurrentContext === "subNav") {
- ariaCurrentValue = "location";
- } else if (this.ariaCurrentContext === "parentNav") {
- if (
- this.router.currentRouteName !== this.route && // not the current route
- this.router.currentRoute.parent.name.includes(this.route) // but is the current parent route
- ) {
- return "page";
- }
- }
-
- return this.router.currentRouteName === this.route
- ? ariaCurrentValue
- : null;
+ get ariaCurrent() {
+ // when there are multiple levels of navigation
+ // we want the active parent to get `aria-current="page"`
+ // and the active child to get `aria-current="location"`
+ if (
+ this.args.ariaCurrentContext === "parentNav" &&
+ this.router.currentRouteName !== this.args.route && // not the current route
+ this.router.currentRoute.parent.name.includes(this.args.route) // but is the current parent route
+ ) {
+ return "page";
}
- ),
-});
+
+ if (this.router.currentRouteName !== this.args.route) {
+ return null;
+ }
+
+ if (this.args.ariaCurrentContext === "subNav") {
+ return "location";
+ } else {
+ return "page";
+ }
+ }
+}
diff --git a/app/assets/javascripts/discourse/app/components/user-nav.hbs b/app/assets/javascripts/discourse/app/components/user-nav.hbs
index c894eef5847..9fad9589576 100644
--- a/app/assets/javascripts/discourse/app/components/user-nav.hbs
+++ b/app/assets/javascripts/discourse/app/components/user-nav.hbs
@@ -4,15 +4,15 @@
@ariaLabel="User primary"
>
{{#unless @user.profile_hidden}}
-
+
{{d-icon "user"}}
{{i18n "user.summary.title"}}
{{d-icon "stream"}}
{{i18n "user.activity_stream"}}
@@ -23,8 +23,8 @@
{{#if @showNotificationsTab}}
{{d-icon "bell" class="glyph"}}
{{i18n "user.notifications"}}
@@ -34,8 +34,8 @@
{{#if @showPrivateMessages}}
{{d-icon "envelope"}}
{{i18n "user.private_messages"}}
@@ -45,8 +45,8 @@
{{#if @canInviteToForum}}
{{d-icon "user-plus"}}
{{i18n "user.invited.title"}}
@@ -54,7 +54,7 @@
{{/if}}
{{#if @showBadges}}
-
+
{{d-icon "certificate"}}
{{i18n "badges.title"}}
@@ -69,8 +69,8 @@
{{#if @user.can_edit}}
{{d-icon "cog"}}
{{i18n "user.preferences"}}
diff --git a/app/assets/javascripts/discourse/app/templates/preferences.hbs b/app/assets/javascripts/discourse/app/templates/preferences.hbs
index bde5fc4dd19..cc8cfd4da26 100644
--- a/app/assets/javascripts/discourse/app/templates/preferences.hbs
+++ b/app/assets/javascripts/discourse/app/templates/preferences.hbs
@@ -4,8 +4,8 @@
{{d-icon "user"}}
{{i18n "user.preferences_nav.account"}}
@@ -13,8 +13,8 @@
{{d-icon "lock"}}
{{i18n "user.preferences_nav.security"}}
@@ -22,8 +22,8 @@
{{d-icon "user"}}
{{i18n "user.preferences_nav.profile"}}
@@ -31,8 +31,8 @@
{{d-icon "envelope"}}
{{i18n "user.preferences_nav.emails"}}
@@ -40,8 +40,8 @@
{{d-icon "bell"}}
{{i18n "user.preferences_nav.notifications"}}
@@ -50,8 +50,8 @@
{{#if this.model.can_change_tracking_preferences}}
{{d-icon "plus"}}
{{i18n "user.preferences_nav.tracking"}}
@@ -60,8 +60,8 @@
{{d-icon "users"}}
{{i18n "user.preferences_nav.users"}}
@@ -69,8 +69,8 @@
{{d-icon "desktop"}}
{{i18n "user.preferences_nav.interface"}}
@@ -79,8 +79,8 @@
{{#if (not (eq this.siteSettings.navigation_menu "legacy"))}}