From 5402c0ac3dc02fad6cdf2ab2c71b1bd9c173870e Mon Sep 17 00:00:00 2001 From: programminglaboratorys Date: Wed, 18 Sep 2024 20:23:03 +0300 Subject: [PATCH] fixed menu by set-status-submenu --- src/plugins/statusPresets/index.tsx | 36 +++++++++++++++-------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/plugins/statusPresets/index.tsx b/src/plugins/statusPresets/index.tsx index 06d59a711..3d3484c9c 100644 --- a/src/plugins/statusPresets/index.tsx +++ b/src/plugins/statusPresets/index.tsx @@ -55,39 +55,41 @@ const settings = definePluginSettings({ }); function StatusMenuItem({ status }: { status: DiscordStatus; }) { - return ( console.log("pog")} - render={() => (
-
{status.status}
-
{status.text}
-
)} - />); + return; } function MakeContextCallback(): NavContextMenuPatchCallback { return (children, contextMenuApiArguments) => { - children[1]?.props.children.props.children.props.children.splice(1, 0, + console.log("BLAH. presets", children); + children[0]?.props.children.splice(1, 0, - {Object.values((settings.store.StatusPresets as { [k: string]: DiscordStatus; })).map(status => )} + {Object.values((settings.store.StatusPresets as { [k: string]: DiscordStatus; })).map(status => console.log("pog")} + render={() => (
+
{status.status}
+
{status.text}
+
)} + />)}
); }; } export default definePlugin({ - name: "StatusPresetsS", + name: "StatusPresets_", description: "do now and think later", authors: [Devs.Dolfies], settings: settings, + dependencies: ["ContextMenuAPI"], patches: [ { find: ".Messages.CUSTOM_STATUS_CLEAR_AFTER", @@ -98,7 +100,7 @@ export default definePlugin({ } ], contextMenus: { - "status": MakeContextCallback() + "set-status-submenu": MakeContextCallback() }, renderRememberButton({ statue }: { statue: DiscordStatus; }) { if (!statue) return;