BetterSettings: Drop dead section
This commit is contained in:
parent
0e5305ca81
commit
49cc5c0bf7
1 changed files with 3 additions and 16 deletions
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { disableStyle, enableStyle } from "@api/Styles";
|
||||
import { AchievementsIcon, AppsIcon, CreditCardIcon, EquicordIcon, GameControllerIcon, HammerAndChiselIcon, HammerIcon, MainSettingsIcon, PencilSparkleIcon, UserIcon } from "@components/Icons";
|
||||
import { AchievementsIcon, AppsIcon, CreditCardIcon, EquicordIcon, GameControllerIcon, HammerAndChiselIcon, MainSettingsIcon, PencilSparkleIcon, UserIcon } from "@components/Icons";
|
||||
import { buildPluginMenuEntries, buildThemeMenuEntries } from "@equicordplugins/equicordToolbox/menu";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { classNameFactory } from "@utils/css";
|
||||
|
|
@ -32,8 +32,7 @@ const SECTION_ICONS: Record<string, Icon> = {
|
|||
activity_section: GameControllerIcon,
|
||||
developer_section: HammerAndChiselIcon,
|
||||
utility_section: MainSettingsIcon,
|
||||
playgrounds_section: AchievementsIcon,
|
||||
build_overrides_section: HammerIcon,
|
||||
playgrounds: AchievementsIcon,
|
||||
};
|
||||
|
||||
const settings = definePluginSettings({
|
||||
|
|
@ -170,24 +169,12 @@ export default definePlugin({
|
|||
find: "#{intl::USER_SETTINGS_ACTIONS_MENU_LABEL}",
|
||||
predicate: () => settings.store.organizeMenu,
|
||||
replacement: [
|
||||
{
|
||||
match: /"clear-build-override"\)\]\}/,
|
||||
replace: '$&,"build_overrides_section"'
|
||||
},
|
||||
{
|
||||
match: /children:\[(\i),null!=(\i).{0,30}\}\),(\i)\](?<=\1=(?:function|.{0,30}\.openUserSettings).+?)/, // TODO .{0,30}\.openUserSettings is stable compat
|
||||
replace: "children:$self.transformSettingsEntries([$1,$2,$3])",
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
find: '},"design-systems")',
|
||||
predicate: () => settings.store.organizeMenu,
|
||||
replacement: {
|
||||
match: /\},"playgrounds"\)/,
|
||||
replace: '},"playgrounds_section")'
|
||||
}
|
||||
},
|
||||
],
|
||||
|
||||
// This is the very outer layer of the entire ui, so we can't wrap this in an ErrorBoundary
|
||||
|
|
@ -229,7 +216,7 @@ export default definePlugin({
|
|||
{children}
|
||||
</Menu.MenuItem>
|
||||
);
|
||||
} else if (key?.endsWith("_section") && (props.label ?? SECTION_NAMES[key])) {
|
||||
} else if ((key?.endsWith("_section") || key === "playgrounds") && (props.label ?? SECTION_NAMES[key])) {
|
||||
const iconLeft = SECTION_ICONS[key];
|
||||
const children: any = [].concat(props.children ?? []).flat(Infinity);
|
||||
const logoutItem = children.find(c => c?.key === "logout_sidebar_item");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue