From 096ee057c2b616577c0c5f4d1541ac0208957dcb Mon Sep 17 00:00:00 2001 From: programminglaboratorys Date: Sat, 21 Sep 2024 17:44:42 +0300 Subject: [PATCH] attempt to make it removal --- src/plugins/statusPresets/index.tsx | 51 +++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/src/plugins/statusPresets/index.tsx b/src/plugins/statusPresets/index.tsx index 28468c806..e2b769e67 100644 --- a/src/plugins/statusPresets/index.tsx +++ b/src/plugins/statusPresets/index.tsx @@ -21,7 +21,7 @@ import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; import { findByPropsLazy } from "@webpack"; -import { Button, Menu, Text, Toasts } from "@webpack/common"; +import { Button, Menu, Text, Toasts, useState } from "@webpack/common"; const Components = findByPropsLazy("Status"); const StatusStyles = findByPropsLazy("statusItem"); @@ -50,8 +50,45 @@ const settings = definePluginSettings({ } }); +const RenderStatusMenuItem = ({ status }) => { + + const [isHovering, setIsHovering] = useState(false); + const handleMouseOver = () => { + setIsHovering(true); + }; + + const handleMouseOut = () => { + setIsHovering(false); + }; + + return
+ {isHovering ? { + delete settings.store.StatusPresets[status.text]; + Toasts.show({ + message: "Successfully removed Status", + type: Toasts.Type.SUCCESS, + id: Toasts.genId() + }); + }} + /> : } +
{status.status}
+
{status.text}
+
; +}; + function MakeContextCallback(): NavContextMenuPatchCallback { - return (children, contextMenuApiArguments) => { + return (children, _) => { console.log("BLAH. presets", children); children[0]?.props.children.splice(1, 0, console.log("pog")} - render={() => (
-
{status.status}
-
{status.text}
-
)} + render={() => } />)}
); @@ -101,6 +132,6 @@ export default definePlugin({ type: Toasts.Type.SUCCESS, id: Toasts.genId() }); - }}>Remember; + }} style={{ marginRight: "20px" }}>Remember; } });