mirror of
https://github.com/System-End/Vencord.git
synced 2026-04-19 20:55:13 +00:00
fix settings - again
This commit is contained in:
parent
dd9a14a4ad
commit
d716727e45
1 changed files with 30 additions and 19 deletions
|
|
@ -35,7 +35,7 @@ let LayoutTypes = {
|
|||
PANEL: 3,
|
||||
PANE: 4
|
||||
};
|
||||
waitFor(["SECTION", "SIDEBAR_ITEM", "PANEL", "PANE"], v => LayoutTypes = v);
|
||||
waitFor(["SECTION", "SIDEBAR_ITEM", "PANEL"], v => LayoutTypes = v);
|
||||
|
||||
const FallbackSectionTypes = {
|
||||
HEADER: "HEADER",
|
||||
|
|
@ -164,6 +164,34 @@ export default definePlugin({
|
|||
buildEntry(options: EntryOptions): SettingsLayoutNode {
|
||||
const { key, title, panelTitle = title, Component, Icon } = options;
|
||||
|
||||
const panel: SettingsLayoutNode = {
|
||||
key: key + "_panel",
|
||||
type: LayoutTypes.PANEL,
|
||||
useTitle: () => panelTitle,
|
||||
};
|
||||
|
||||
const render = {
|
||||
// FIXME
|
||||
StronglyDiscouragedCustomComponent: () => <Component />,
|
||||
render: () => <Component />,
|
||||
};
|
||||
|
||||
// FIXME
|
||||
if (LayoutTypes.PANE) {
|
||||
panel.buildLayout = () => [
|
||||
{
|
||||
key: key + "_pane",
|
||||
type: LayoutTypes.PANE,
|
||||
useTitle: () => panelTitle,
|
||||
buildLayout: () => [],
|
||||
...render
|
||||
}
|
||||
];
|
||||
} else {
|
||||
Object.assign(panel, render);
|
||||
panel.buildLayout = () => [];
|
||||
}
|
||||
|
||||
return ({
|
||||
key,
|
||||
type: LayoutTypes.SIDEBAR_ITEM,
|
||||
|
|
@ -172,24 +200,7 @@ export default definePlugin({
|
|||
getLegacySearchKey: () => title.toUpperCase(),
|
||||
useTitle: () => title,
|
||||
icon: () => <Icon width={20} height={20} />,
|
||||
buildLayout: () => [
|
||||
{
|
||||
key: key + "_panel",
|
||||
type: LayoutTypes.PANEL,
|
||||
useTitle: () => panelTitle,
|
||||
buildLayout: () => [
|
||||
{
|
||||
key: key + "_pane",
|
||||
type: LayoutTypes.PANE,
|
||||
buildLayout: () => [],
|
||||
// FIXME
|
||||
StronglyDiscouragedCustomComponent: () => <Component />,
|
||||
render: () => <Component />,
|
||||
useTitle: () => panelTitle
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
buildLayout: () => [panel]
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue