From 9f25f34780cdd8e4955ebda40bc485e0f07c2265 Mon Sep 17 00:00:00 2001 From: programminglaboratorys Date: Mon, 30 Sep 2024 04:14:51 +0300 Subject: [PATCH] better formatting for render component and patch improvment --- src/plugins/statusPresets/index.tsx | 38 ++++++++++++++++------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/plugins/statusPresets/index.tsx b/src/plugins/statusPresets/index.tsx index 86cc23da4..99d5d076d 100644 --- a/src/plugins/statusPresets/index.tsx +++ b/src/plugins/statusPresets/index.tsx @@ -131,30 +131,34 @@ export default definePlugin({ } }, { - find: "!eS&&(0,i.", + find: ".Messages.STATUS_MENU_LABEL", replacement: { - match: /!eS&&(\(0,i.jsxs\)\(i\.Fragment,{children)/, - replace: "$self.render(eI, eC, W, w.Ok),true&&$1" + match: /!\i&&(.{0,15}\i\.Fragment.+null==(\i).+customEmojiPlaceholder\}\),onClick:([^}]+))/, + replace: "$self.render($2, $3}),false&&$1" } } ], - render(status, openStatusModal: () => void, OnClose: () => void) { + render(status, openCustomStatusModal: () => void) { if (!customStatusSettings) return; - const openModal = () => { OnClose(); openStatusModal(); }; return
- {status == null ?
} - label="Set Custom Status" renderSubmenu={StatusSubMenuComponent} /> : customStatusSettings.updateSetting(null)}>} - icon={() => status.emoji != null ? : null} - label="Edit Custom Status" renderSubmenu={StatusSubMenuComponent} />} + {status == null ? +
} + label="Set Custom Status" renderSubmenu={StatusSubMenuComponent} + /> + : + customStatusSettings.updateSetting(null)}>} + icon={() => status.emoji != null ? : null} + label="Edit Custom Status" renderSubmenu={StatusSubMenuComponent} + />} ; }, renderRememberButton(statue: DiscordStatus) {