RosePlugs: replace stub row with discovered plugin settings rows
This commit is contained in:
parent
fcdaa831e6
commit
76e51cd11e
1 changed files with 14 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ import { logger } from "@vendetta";
|
|||
import { getAssetIDByName } from "@vendetta/ui/assets";
|
||||
import Settings from "./ui/Settings";
|
||||
import patchRosiesPlugsSection, { SectionRow } from "./patches/settings";
|
||||
import { discoverRosiesPlugins } from "./patches/discoverPlugins";
|
||||
|
||||
let unpatch: (() => void) | undefined;
|
||||
|
||||
|
|
@ -10,14 +11,25 @@ function StubPluginsScreen() {
|
|||
}
|
||||
|
||||
function buildRows(): SectionRow[] {
|
||||
return [
|
||||
const rows: SectionRow[] = [
|
||||
{
|
||||
key: "ROSES_PLUGS_STUB",
|
||||
key: "ROSES_PLUGS_BROWSER",
|
||||
title: () => "Plugins",
|
||||
icon: getAssetIDByName("SettingsIcon"),
|
||||
page: StubPluginsScreen,
|
||||
},
|
||||
];
|
||||
|
||||
for (const plugin of discoverRosiesPlugins()) {
|
||||
if (!plugin.settingsComponent) continue;
|
||||
rows.push({
|
||||
key: `ROSES_PLUGS_${plugin.id}`,
|
||||
title: () => plugin.name,
|
||||
page: plugin.settingsComponent as any,
|
||||
});
|
||||
}
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue