mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-26 17:26:22 +00:00
fixed menu by set-status-submenu
This commit is contained in:
parent
a9e9571706
commit
5402c0ac3d
1 changed files with 19 additions and 17 deletions
|
@ -55,39 +55,41 @@ const settings = definePluginSettings({
|
||||||
});
|
});
|
||||||
|
|
||||||
function StatusMenuItem({ status }: { status: DiscordStatus; }) {
|
function StatusMenuItem({ status }: { status: DiscordStatus; }) {
|
||||||
return (<Menu.MenuItem
|
return;
|
||||||
id={"status-presets-" + status.text}
|
|
||||||
label={status.status}
|
|
||||||
action={() => console.log("pog")}
|
|
||||||
render={() => (<div className={StatusStyles.statusItem}><Components.Status
|
|
||||||
status={status} className={StatusStyles.icon}
|
|
||||||
size={10}
|
|
||||||
color={statusCrossSponding[status.status] || "currentColor"}
|
|
||||||
/>
|
|
||||||
<div className={StatusStyles.status}>{status.status}</div>
|
|
||||||
<div className={StatusStyles.description}>{status.text}</div>
|
|
||||||
</div>)}
|
|
||||||
/>);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function MakeContextCallback(): NavContextMenuPatchCallback {
|
function MakeContextCallback(): NavContextMenuPatchCallback {
|
||||||
return (children, contextMenuApiArguments) => {
|
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,
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
id="status-presets"
|
id="status-presets"
|
||||||
label="Presets" // add an icon to fit in
|
label="Presets" // add an icon to fit in
|
||||||
>
|
>
|
||||||
{Object.values((settings.store.StatusPresets as { [k: string]: DiscordStatus; })).map(status => <StatusMenuItem status={status} />)}
|
{Object.values((settings.store.StatusPresets as { [k: string]: DiscordStatus; })).map(status => <Menu.MenuItem
|
||||||
|
id={"status-presets-" + status.text}
|
||||||
|
label={status.status}
|
||||||
|
action={() => console.log("pog")}
|
||||||
|
render={() => (<div className={StatusStyles.statusItem}><Components.Status
|
||||||
|
status={status} className={StatusStyles.icon}
|
||||||
|
size={10}
|
||||||
|
color={statusCrossSponding[status.status] || "currentColor"}
|
||||||
|
/>
|
||||||
|
<div className={StatusStyles.status}>{status.status}</div>
|
||||||
|
<div className={StatusStyles.description}>{status.text}</div>
|
||||||
|
</div>)}
|
||||||
|
/>)}
|
||||||
</Menu.MenuItem>
|
</Menu.MenuItem>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "StatusPresetsS",
|
name: "StatusPresets_",
|
||||||
description: "do now and think later",
|
description: "do now and think later",
|
||||||
authors: [Devs.Dolfies],
|
authors: [Devs.Dolfies],
|
||||||
settings: settings,
|
settings: settings,
|
||||||
|
dependencies: ["ContextMenuAPI"],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".Messages.CUSTOM_STATUS_CLEAR_AFTER",
|
find: ".Messages.CUSTOM_STATUS_CLEAR_AFTER",
|
||||||
|
@ -98,7 +100,7 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
contextMenus: {
|
contextMenus: {
|
||||||
"status": MakeContextCallback()
|
"set-status-submenu": MakeContextCallback()
|
||||||
},
|
},
|
||||||
renderRememberButton({ statue }: { statue: DiscordStatus; }) {
|
renderRememberButton({ statue }: { statue: DiscordStatus; }) {
|
||||||
if (!statue) return;
|
if (!statue) return;
|
||||||
|
|
Loading…
Reference in a new issue