Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
d8d7347fdb
2 changed files with 22 additions and 10 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "equicord",
|
||||
"private": "true",
|
||||
"version": "1.14.4.1",
|
||||
"version": "1.14.5.0",
|
||||
"description": "The other cutest Discord client mod",
|
||||
"homepage": "https://github.com/Equicord/Equicord#readme",
|
||||
"bugs": {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import { gitHashShort } from "@shared/vencordUserAgent";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { isTruthy } from "@utils/guards";
|
||||
import definePlugin, { IconProps, OptionType } from "@utils/types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { findByPropsLazy, waitFor } from "@webpack";
|
||||
import { React } from "@webpack/common";
|
||||
import type { ComponentType, PropsWithChildren, ReactNode } from "react";
|
||||
|
||||
|
|
@ -46,7 +46,14 @@ const enum LayoutType {
|
|||
CUSTOM = 18
|
||||
}
|
||||
|
||||
const LayoutTypes: typeof LayoutType = findByPropsLazy("SECTION", "SIDEBAR_ITEM", "PANEL");
|
||||
let LayoutTypes = {
|
||||
SECTION: 1,
|
||||
SIDEBAR_ITEM: 2,
|
||||
PANEL: 3,
|
||||
CATEGORY: 5,
|
||||
CUSTOM: 19,
|
||||
};
|
||||
waitFor(["SECTION", "SIDEBAR_ITEM", "PANEL", "CUSTOM"], v => LayoutTypes = v);
|
||||
|
||||
const enum SectionType {
|
||||
HEADER = "HEADER",
|
||||
|
|
@ -175,20 +182,25 @@ export default definePlugin({
|
|||
key: key + "_panel",
|
||||
type: LayoutTypes.PANEL,
|
||||
useTitle: () => panelTitle,
|
||||
buildLayout: () => [],
|
||||
StronglyDiscouragedCustomComponent: () => <Component />,
|
||||
render: () => <Component />,
|
||||
buildLayout: () => [{
|
||||
type: LayoutTypes.CATEGORY,
|
||||
key: key + "_category",
|
||||
buildLayout: () => [{
|
||||
type: LayoutTypes.CUSTOM,
|
||||
key: key + "_custom",
|
||||
Component: Component,
|
||||
useSearchTerms: () => [title]
|
||||
}]
|
||||
}]
|
||||
};
|
||||
|
||||
return {
|
||||
return ({
|
||||
key,
|
||||
type: LayoutTypes.SIDEBAR_ITEM,
|
||||
legacySearchKey: title.toUpperCase(),
|
||||
getLegacySearchKey: () => title.toUpperCase(),
|
||||
useTitle: () => title,
|
||||
icon: () => <Icon width={20} height={20} />,
|
||||
buildLayout: () => [panel]
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
getSettingsSectionMappings() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue