From 1ed5981c6e6b1810220168766469cd0e5f5e7bc8 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sun, 1 Sep 2024 20:47:41 -0400 Subject: [PATCH] For Indi --- src/plugins/alwaysExpandRoles/README.md | 3 --- src/plugins/alwaysExpandRoles/index.ts | 23 ++++++++++++++++++++--- src/plugins/alwaysExpandRoles/style.css | 3 +++ 3 files changed, 23 insertions(+), 6 deletions(-) delete mode 100644 src/plugins/alwaysExpandRoles/README.md create mode 100644 src/plugins/alwaysExpandRoles/style.css diff --git a/src/plugins/alwaysExpandRoles/README.md b/src/plugins/alwaysExpandRoles/README.md deleted file mode 100644 index 344268cb..00000000 --- a/src/plugins/alwaysExpandRoles/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Always Expand Roles - -Always expands the role list in profile popouts diff --git a/src/plugins/alwaysExpandRoles/index.ts b/src/plugins/alwaysExpandRoles/index.ts index 1c20b977..bf3c7fd6 100644 --- a/src/plugins/alwaysExpandRoles/index.ts +++ b/src/plugins/alwaysExpandRoles/index.ts @@ -16,9 +16,20 @@ * along with this program. If not, see . */ -import { migratePluginSettings } from "@api/Settings"; +import { definePluginSettings, migratePluginSettings } from "@api/Settings"; +import { disableStyle, enableStyle } from "@api/Styles"; import { Devs } from "@utils/constants"; -import definePlugin from "@utils/types"; +import definePlugin, { OptionType } from "@utils/types"; + +import style from "./style.css?managed"; + +const settings = definePluginSettings({ + hideArrow: { + type: OptionType.BOOLEAN, + default: false, + description: "Hide Arrow", + }, +}); migratePluginSettings("AlwaysExpandRoles", "ShowAllRoles"); export default definePlugin({ @@ -33,5 +44,11 @@ export default definePlugin({ replace: (_, rest, setExpandedRoles) => `${rest}!0)` } } - ] + ], + start() { + if (settings.store.hideArrow) enableStyle(style); + }, + stop() { + if (settings.store.hideArrow) disableStyle(style); + } }); diff --git a/src/plugins/alwaysExpandRoles/style.css b/src/plugins/alwaysExpandRoles/style.css new file mode 100644 index 00000000..7ffb11ed --- /dev/null +++ b/src/plugins/alwaysExpandRoles/style.css @@ -0,0 +1,3 @@ +[aria-label]:has(> [class^="collapseButton_"]) { + display: none +}