Equicord/src/equicordplugins/_api/userArea.ts
Jakub Bednarski ce64a1c2e4
feat(declutter): combine functionality of annamox & betteruserarea while adding new selectors to remove unwanted ui elements (#846)
* feat(HidePersonalization): Add a plugin that allows to hide personalization features such as avatar decorations, nameplates, profile effects, and clan tags with customizable options

* fix(HidePersonalization): Fix no predicate bool handling on clan tags

* feat(Cleanify): Introduce Cleanify plugin to enhance UI customization and migrate settings from BetterUserArea and Anammox. This plugin combines the functionality of them and adds new features

* rename(Cleanify -> Declutter): Rename plugin and add Questify conflict detection

* Update index.tsx

* Update index.tsx

* Update index.tsx

* Update index.tsx

* Update index.tsx

---------

Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com>
2026-03-01 21:06:15 -05:00

48 lines
1.5 KiB
TypeScript

/*
* Vencord, a Discord client mod
* Copyright (c) 2025 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { isPluginEnabled } from "@api/PluginManager";
import declutter from "@equicordplugins/declutter";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findCssClassesLazy } from "@webpack";
const { iconForeground } = findCssClassesLazy("iconForeground", "accountPopoutButtonWrapper");
export default definePlugin({
name: "UserAreaAPI",
description: "API to add buttons to the user area panel.",
authors: [Devs.prism],
patches: [
{
find: ".WIDGETS_RTC_UPSELL_COACHMARK),",
replacement: [
{
match: /(?<=className:(\i)\.\i,style:\i,)children:\[/,
replace: "children:[...$self.renderButtons(arguments[0],$1),"
},
// fix discord weird shrink with extra buttons
{
match: /(?<=\{ref:\i,)style:(\i)/,
replace: "style:{...$1,minWidth:0}"
}
]
}
],
renderButtons(props: { nameplate?: any; }) {
return Vencord.Api.UserArea._renderButtons({
nameplate: props.nameplate,
iconForeground: props.nameplate != null ? iconForeground : void 0,
hideTooltips: this.shouldHideTooltips()
});
},
shouldHideTooltips() {
return isPluginEnabled(declutter.name) && declutter.settings.store.removeButtonTooltips;
}
});