mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-09 06:33:03 -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() {
|
stop() {
|
||||||
document.removeEventListener("keydown", handleKeydown);
|
document.removeEventListener("keydown", handleKeydown);
|
||||||
},
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -44,6 +44,25 @@ function VencordPopout(onClose: () => void) {
|
||||||
{Object.entries(plugin.toolboxActions).map(([text, action]) => {
|
{Object.entries(plugin.toolboxActions).map(([text, action]) => {
|
||||||
const key = `vc-toolbox-${plugin.name}-${text}`;
|
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 (
|
return (
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
id={key}
|
id={key}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue