Skip to content

Commit

Permalink
Switched to BD Components
Browse files Browse the repository at this point in the history
  • Loading branch information
domi-btnr committed Feb 2, 2025
1 parent 71b01da commit a92e67a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
26 changes: 15 additions & 11 deletions InvisibleTyping/components/settings.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
import React from "react";
import { Webpack } from "@api";
import { Components } from "@api";

import SettingsItems from "./settings.json";

import Settings from "../modules/settings";
import { useStateFromStores } from "../modules/shared";
import SettingsItems from "./settings.json";

const FormSwitch = Webpack.getByStrings('.labelRow', 'useId', 'DESCRIPTION', { searchExports: true });
const { SettingItem, SwitchInput } = Components;

function SwitchItem(props) {
const value = useStateFromStores([Settings], () => Settings.get(props.id, props.value));

return (
<FormSwitch
<SettingItem
{...props}
value={value}
children={props.name}
onChange={value => {
Settings.set(props.id, value);
}}
/>
inline={true}
>
<SwitchInput
value={value}
onChange={v => {
Settings.set(props.id, v);
}}
/>
</SettingItem>
);
}

Expand Down
2 changes: 2 additions & 0 deletions InvisibleTyping/components/typingButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from "react";
import { Components, ContextMenu, UI, Webpack } from "@api";

import Keyboard from "./icons/keyboard";
import styles from "./typingButton.scss";

import Settings from "../modules/settings";
import { buildClassName, TypingModule, useStateFromStores } from "../modules/shared";

Expand Down
11 changes: 9 additions & 2 deletions InvisibleTyping/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"name": "InvisibleTyping",
"version": "1.3.6",
"version": "1.3.7",
"author": "Strencher",
"authorId": "415849376598982656",
"description": "Enhanced version of silent typing.",
"source": "https://github.com/Strencher/BetterDiscordStuff/blob/master/InvisibleTyping/InvisibleTyping.plugin.js",
"invite": "gvA2ree",
"changelog": [
{
"title": "Improved Settings",
"type": "improved",
"items": [
"Settings use BD Components now"
]
},
{
"title": "Fixed",
"type": "fixed",
Expand All @@ -15,5 +22,5 @@
]
}
],
"changelogDate": "2025-01-30"
"changelogDate": "2025-02-02"
}

0 comments on commit a92e67a

Please sign in to comment.