1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 18:06:22 +00:00

better formatting for render component and patch improvment

This commit is contained in:
programminglaboratorys 2024-09-30 04:14:51 +03:00
parent 4ccf12f5b4
commit 9f25f34780

View file

@ -131,30 +131,34 @@ export default definePlugin({
} }
}, },
{ {
find: "!eS&&(0,i.", find: ".Messages.STATUS_MENU_LABEL",
replacement: { replacement: {
match: /!eS&&(\(0,i.jsxs\)\(i\.Fragment,{children)/, match: /!\i&&(.{0,15}\i\.Fragment.+null==(\i).+customEmojiPlaceholder\}\),onClick:([^}]+))/,
replace: "$self.render(eI, eC, W, w.Ok),true&&$1" replace: "$self.render($2, $3}),false&&$1"
} }
} }
], ],
render(status, openStatusModal: () => void, OnClose: () => void) { render(status, openCustomStatusModal: () => void) {
if (!customStatusSettings) return; if (!customStatusSettings) return;
const openModal = () => { OnClose(); openStatusModal(); };
return <ErrorBoundary> return <ErrorBoundary>
<div className={StatusStyles.menuDivider} /> <div className={StatusStyles.menuDivider} />
{status == null ? <PMenu {status == null ?
id="sp-custom/presets-status" <PMenu
action="PRESS_SET_STATUS" id="sp-custom/presets-status"
onClick={openModal} action="PRESS_SET_STATUS"
icon={() => <div className={StatusStyles.customEmojiPlaceholder} />} onClick={openCustomStatusModal}
label="Set Custom Status" renderSubmenu={StatusSubMenuComponent} /> : <PMenu icon={() => <div className={StatusStyles.customEmojiPlaceholder} />}
id="sp-edit/presets-status" label="Set Custom Status" renderSubmenu={StatusSubMenuComponent}
action="PRESS_EDIT_CUSTOM_STATUS" />
onClick={openModal} :
hint={<Clickable className={StatusStyles.clearCustomStatusHint} onClick={() => customStatusSettings.updateSetting(null)}><Icons.CircleXIcon size="sm" /></Clickable>} <PMenu
icon={() => status.emoji != null ? <EmojiComponent emoji={status.emoji} animate={false} hideTooltip={false} /> : null} id="sp-edit/presets-status"
label="Edit Custom Status" renderSubmenu={StatusSubMenuComponent} />} action="PRESS_EDIT_CUSTOM_STATUS"
onClick={openCustomStatusModal}
hint={<Clickable className={StatusStyles.clearCustomStatusHint} onClick={() => customStatusSettings.updateSetting(null)}><Icons.CircleXIcon size="sm" /></Clickable>}
icon={() => status.emoji != null ? <EmojiComponent emoji={status.emoji} animate={false} hideTooltip={false} /> : null}
label="Edit Custom Status" renderSubmenu={StatusSubMenuComponent}
/>}
</ErrorBoundary>; </ErrorBoundary>;
}, },
renderRememberButton(statue: DiscordStatus) { renderRememberButton(statue: DiscordStatus) {