Skip to content

Commit

Permalink
i did another stupid
Browse files Browse the repository at this point in the history
  • Loading branch information
grngxd committed Nov 25, 2024
1 parent 8827526 commit ff6f7b1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 19 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ a bad discord client mod inspired by [shelter]("https://shelter.uwu.network").

1. copy & paste the contents of `veil.js` into the console of the discord web client.
2. youre done
</details>
</details>

## screenshots

## plugins
find the template [here](https://github.com/grngxd/veil-plugin-template).
2 changes: 1 addition & 1 deletion packages/core/plugins/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const add = async (url: string, alsoInit = true): Promise<Plugin | null>
meta.enabled = false;
return null;
}
} else {
} else {
return existingPlugin;
}
}
Expand Down
49 changes: 32 additions & 17 deletions packages/react/components/pages/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,26 @@ const PluginItem = ({ plugin }: { plugin: Plugin }) => {
flexDirection: "column",
})}
>
<Text type="h3">{plugin.metadata.name}</Text>
<Text
className={css({
color: "var(--text-muted)",
<div
class={css({
display: "flex",
gap: "0.5ch",
alignItems: "center",
})}
>
{plugin.metadata.id}
</Text>
<Text type="h3">{plugin.metadata.name}</Text>
<Text
className={css({
color: "var(--text-muted)",
})}
>
({plugin.metadata.id})
</Text>
</div>
<Text
className={css({
color: "var(--text-muted)",
marginTop: "-0.25rem",
})}
>
{plugin.metadata.description}
Expand All @@ -50,18 +59,11 @@ const PluginItem = ({ plugin }: { plugin: Plugin }) => {
<div
class={css({
display: "flex",
flexDirection: "column",
alignItems: "flex-end",
justifyContent: "flex-end",
alignItems: "center",
gap: "0.375rem",
})}
>
<Toggle
checked={plugin.metadata.enabled}
onChange={(value) => {
plugins.setPluginEnabled(plugin.metadata.id, value);
plugins.plugins.set(new Map(plugins.plugins.get()));
}}
/>
<Button
colour="red"
onClick={() => {
Expand All @@ -70,6 +72,14 @@ const PluginItem = ({ plugin }: { plugin: Plugin }) => {
>
Remove
</Button>

<Toggle
checked={plugin.metadata.enabled}
onChange={(value) => {
plugins.setPluginEnabled(plugin.metadata.id, value);
plugins.plugins.set(new Map(plugins.plugins.get()));
}}
/>
</div>
</div>
);
Expand Down Expand Up @@ -157,10 +167,10 @@ const SettingsPage = () => {
checked={store.get()}
onChange={(value) => store.set(value)}
/>
) : (
) : (
<TextBox
value={String(store.get())}
onChange={(v) => setLink(v)}
onChange={(v) => store.set(v)}
/>
)}
</div>
Expand Down Expand Up @@ -222,6 +232,11 @@ const SettingsPage = () => {
})}
value={link}
onChange={(v) => setLink(v)}
onSubmit={() => {
if (link.trim() === "") return;
plugins.add(link.trim());
setLink("");
}}
/>

<Button
Expand Down

0 comments on commit ff6f7b1

Please sign in to comment.