DEV: Facilitate replacing category lock icon in components

DEV: Facilitate replacing category lock icon in components

diff --git a/app/assets/javascripts/discourse/app/components/category-title-link.js b/app/assets/javascripts/discourse/app/components/category-title-link.js
index c6dacce..7cdf243 100644
--- a/app/assets/javascripts/discourse/app/components/category-title-link.js
+++ b/app/assets/javascripts/discourse/app/components/category-title-link.js
@@ -1,4 +1,6 @@
 import Component from "@ember/component";
 export default Component.extend({
-  tagName: "h3"
+  tagName: "h3",
+  // icon name defined here so it can be easily overriden in theme components
+  lockIcon: "lock"
 });
diff --git a/app/assets/javascripts/discourse/app/templates/components/category-title-link.hbs b/app/assets/javascripts/discourse/app/templates/components/category-title-link.hbs
index a37e553..9de2a6a 100644
--- a/app/assets/javascripts/discourse/app/templates/components/category-title-link.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/category-title-link.hbs
@@ -2,7 +2,7 @@
   <div class="category-text-title">
     {{category-title-before category=category}}
     {{#if category.read_restricted}}
-      {{d-icon "lock"}}
+      {{d-icon lockIcon}}
     {{/if}}
     <span class="category-name">{{dir-span category.name}}</span>
   </div>

GitHub sha: 2567bb4a

1 Like