mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 09:56:24 +00:00
better formatting for render component and patch improvment
This commit is contained in:
parent
4ccf12f5b4
commit
9f25f34780
1 changed files with 21 additions and 17 deletions
|
@ -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 <ErrorBoundary>
|
||||
<div className={StatusStyles.menuDivider} />
|
||||
{status == null ? <PMenu
|
||||
{status == null ?
|
||||
<PMenu
|
||||
id="sp-custom/presets-status"
|
||||
action="PRESS_SET_STATUS"
|
||||
onClick={openModal}
|
||||
onClick={openCustomStatusModal}
|
||||
icon={() => <div className={StatusStyles.customEmojiPlaceholder} />}
|
||||
label="Set Custom Status" renderSubmenu={StatusSubMenuComponent} /> : <PMenu
|
||||
label="Set Custom Status" renderSubmenu={StatusSubMenuComponent}
|
||||
/>
|
||||
:
|
||||
<PMenu
|
||||
id="sp-edit/presets-status"
|
||||
action="PRESS_EDIT_CUSTOM_STATUS"
|
||||
onClick={openModal}
|
||||
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} />}
|
||||
label="Edit Custom Status" renderSubmenu={StatusSubMenuComponent}
|
||||
/>}
|
||||
</ErrorBoundary>;
|
||||
},
|
||||
renderRememberButton(statue: DiscordStatus) {
|
||||
|
|
Loading…
Reference in a new issue