From 0949a8108a0d8fd264ce49b74321ead953434e8b Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 28 Mar 2023 09:46:53 -0400 Subject: [PATCH] DEV: add component for cross-theme compatibility (#18) --- .../discourse/components/category-icon.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 javascripts/discourse/components/category-icon.js diff --git a/javascripts/discourse/components/category-icon.js b/javascripts/discourse/components/category-icon.js new file mode 100644 index 0000000..4f8629e --- /dev/null +++ b/javascripts/discourse/components/category-icon.js @@ -0,0 +1,16 @@ +/* This component is used in the Category banners theme component */ +/* https://meta.discourse.org/t/category-banners/86241 */ +import MountWidget from "discourse/components/mount-widget"; + +export default class CategoryIcon extends MountWidget { + widget = "category-icon"; + + buildArgs() { + return { category: this.category }; + } + + didReceiveAttrs() { + super.didReceiveAttrs(); + this.queueRerender(); + } +}