mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 22:23:02 -04:00
fix(demonstration): modify the toolbox for checkbox (#179)
* fix(demonstration): modify the toolbox for checkbox * Remove Logger * Remove IsToggled * Fixes --------- Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com>
This commit is contained in:
parent
c26c9f3b64
commit
5bb6148daf
2 changed files with 20 additions and 2 deletions
|
@ -147,6 +147,5 @@ export default definePlugin({
|
|||
},
|
||||
stop() {
|
||||
document.removeEventListener("keydown", handleKeydown);
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -43,6 +43,25 @@ function VencordPopout(onClose: () => void) {
|
|||
>
|
||||
{Object.entries(plugin.toolboxActions).map(([text, action]) => {
|
||||
const key = `vc-toolbox-${plugin.name}-${text}`;
|
||||
|
||||
if (plugin.name === "Demonstration") {
|
||||
const [demonstrationToggled, setToggled] = useState(false);
|
||||
|
||||
return (
|
||||
<Menu.MenuCheckboxItem
|
||||
id="vc-toolbox-demonstration-toggle"
|
||||
key={key}
|
||||
checked={!!demonstrationToggled}
|
||||
label={text}
|
||||
action={
|
||||
() => {
|
||||
action();
|
||||
setToggled(!demonstrationToggled);
|
||||
}
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Menu.MenuItem
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue