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",
|
"name": "equicord",
|
||||||
"private": "true",
|
"private": "true",
|
||||||
"version": "1.14.4.1",
|
"version": "1.14.5.0",
|
||||||
"description": "The other cutest Discord client mod",
|
"description": "The other cutest Discord client mod",
|
||||||
"homepage": "https://github.com/Equicord/Equicord#readme",
|
"homepage": "https://github.com/Equicord/Equicord#readme",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import { gitHashShort } from "@shared/vencordUserAgent";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import { isTruthy } from "@utils/guards";
|
import { isTruthy } from "@utils/guards";
|
||||||
import definePlugin, { IconProps, OptionType } from "@utils/types";
|
import definePlugin, { IconProps, OptionType } from "@utils/types";
|
||||||
import { findByPropsLazy } from "@webpack";
|
import { findByPropsLazy, waitFor } from "@webpack";
|
||||||
import { React } from "@webpack/common";
|
import { React } from "@webpack/common";
|
||||||
import type { ComponentType, PropsWithChildren, ReactNode } from "react";
|
import type { ComponentType, PropsWithChildren, ReactNode } from "react";
|
||||||
|
|
||||||
|
|
@ -46,7 +46,14 @@ const enum LayoutType {
|
||||||
CUSTOM = 18
|
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 {
|
const enum SectionType {
|
||||||
HEADER = "HEADER",
|
HEADER = "HEADER",
|
||||||
|
|
@ -175,20 +182,25 @@ export default definePlugin({
|
||||||
key: key + "_panel",
|
key: key + "_panel",
|
||||||
type: LayoutTypes.PANEL,
|
type: LayoutTypes.PANEL,
|
||||||
useTitle: () => panelTitle,
|
useTitle: () => panelTitle,
|
||||||
buildLayout: () => [],
|
buildLayout: () => [{
|
||||||
StronglyDiscouragedCustomComponent: () => <Component />,
|
type: LayoutTypes.CATEGORY,
|
||||||
render: () => <Component />,
|
key: key + "_category",
|
||||||
|
buildLayout: () => [{
|
||||||
|
type: LayoutTypes.CUSTOM,
|
||||||
|
key: key + "_custom",
|
||||||
|
Component: Component,
|
||||||
|
useSearchTerms: () => [title]
|
||||||
|
}]
|
||||||
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return ({
|
||||||
key,
|
key,
|
||||||
type: LayoutTypes.SIDEBAR_ITEM,
|
type: LayoutTypes.SIDEBAR_ITEM,
|
||||||
legacySearchKey: title.toUpperCase(),
|
|
||||||
getLegacySearchKey: () => title.toUpperCase(),
|
|
||||||
useTitle: () => title,
|
useTitle: () => title,
|
||||||
icon: () => <Icon width={20} height={20} />,
|
icon: () => <Icon width={20} height={20} />,
|
||||||
buildLayout: () => [panel]
|
buildLayout: () => [panel]
|
||||||
};
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getSettingsSectionMappings() {
|
getSettingsSectionMappings() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue