UX: allow component to change lock icons in category boxes (#9)

This commit is contained in:
Joe 2021-12-16 02:33:41 +08:00 committed by GitHub
parent c94585bac0
commit e378f4dcc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -6,6 +6,8 @@ import { isRTL } from "discourse/lib/text-direction";
import { h } from "virtual-dom";
import getURL from "discourse-common/lib/get-url";
import categoryTitleLink from "discourse/components/category-title-link";
import categoriesBoxes from "discourse/components/categories-boxes";
import categoriesBoxesWithTopics from "discourse/components/categories-boxes-with-topics";
import I18n from "I18n";
import { get } from "@ember/object";
import { escapeExpression } from "discourse/lib/utilities";
@ -22,6 +24,14 @@ export default {
lockIcon: lockIcon,
});
categoriesBoxes.reopen({
lockIcon: lockIcon,
});
categoriesBoxesWithTopics.reopen({
lockIcon: lockIcon,
});
function categoryStripe(color, classes) {
var style = color ? "style='background-color: #" + color + ";'" : "";
return "<span class='" + classes + "' " + style + "></span>";