HideGiftButton: actually use findByName
This commit is contained in:
parent
7ac23a90c2
commit
93d6d9b33d
5 changed files with 24 additions and 13 deletions
|
|
@ -37,6 +37,7 @@
|
||||||
"@typescript-eslint/ban-ts-comment": "off",
|
"@typescript-eslint/ban-ts-comment": "off",
|
||||||
"@typescript-eslint/triple-slash-reference": "off",
|
"@typescript-eslint/triple-slash-reference": "off",
|
||||||
"@typescript-eslint/no-non-null-assertion": "off",
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
|
"react/react-in-jsx-scope": "off",
|
||||||
"eol-last": "error"
|
"eol-last": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,6 +1,9 @@
|
||||||
|
.idea
|
||||||
node_modules/
|
node_modules/
|
||||||
dist/
|
dist/
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
yarn.lock
|
yarn.lock
|
||||||
package-lock.json
|
package-lock.json
|
||||||
RichPresence
|
Themer
|
||||||
|
FunnyBackground
|
||||||
|
YouTabRemover
|
||||||
|
|
|
||||||
10
build.mjs
10
build.mjs
|
|
@ -54,7 +54,8 @@ async function buildPlugin(plugin) {
|
||||||
return id.substring(1).replace(/\//g, ".");
|
return id.substring(1).replace(/\//g, ".");
|
||||||
|
|
||||||
const map = {
|
const map = {
|
||||||
react: "window.React"
|
"react": "window.React",
|
||||||
|
"react-native": "globalThis.vendetta.metro.common.ReactNative"
|
||||||
};
|
};
|
||||||
|
|
||||||
return map[id] || null;
|
return map[id] || null;
|
||||||
|
|
@ -71,7 +72,12 @@ async function buildPlugin(plugin) {
|
||||||
].includes(warning.code) && console.warn(warning);
|
].includes(warning.code) && console.warn(warning);
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
nodeResolve(),
|
nodeResolve({
|
||||||
|
resolveOnly: (id) => ![
|
||||||
|
"react",
|
||||||
|
"react-native"
|
||||||
|
].includes(id)
|
||||||
|
}),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
{
|
{
|
||||||
name: "swc",
|
name: "swc",
|
||||||
|
|
|
||||||
17
package.json
17
package.json
|
|
@ -1,23 +1,24 @@
|
||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node build.mjs",
|
"build": "node build.mjs",
|
||||||
|
"watch": "node build.mjs -w",
|
||||||
"lint": "eslint plugins"
|
"lint": "eslint plugins"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^24.0.1",
|
"@rollup/plugin-commonjs": "^24.0.1",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
"@swc/core": "^1.3.36",
|
"@swc/core": "^1.3.42",
|
||||||
"@types/react": "^18.0.28",
|
"@types/react": "^18.0.28",
|
||||||
"@types/react-native": "^0.70.11",
|
"@types/react-native": "^0.70.12",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.53.0",
|
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
||||||
"@typescript-eslint/parser": "^5.53.0",
|
"@typescript-eslint/parser": "^5.56.0",
|
||||||
"esbuild": "^0.17.11",
|
"esbuild": "^0.17.12",
|
||||||
"eslint": "^8.35.0",
|
"eslint": "^8.36.0",
|
||||||
"eslint-plugin-react": "^7.32.2",
|
"eslint-plugin-react": "^7.32.2",
|
||||||
"rollup": "^3.17.3",
|
"rollup": "^3.20.1",
|
||||||
"rollup-plugin-esbuild": "^5.0.0",
|
"rollup-plugin-esbuild": "^5.0.0",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^4.9.5",
|
||||||
"vendetta-types": "^2.3.16"
|
"vendetta-types": "^2.4.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@swc/helpers": "^0.4.14"
|
"@swc/helpers": "^0.4.14"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { logger } from "@vendetta";
|
import { logger } from "@vendetta";
|
||||||
import { find } from "@vendetta/metro";
|
import { findByName } from "@vendetta/metro";
|
||||||
|
|
||||||
const ChatInput = find((m) => typeof m?.defaultProps?.hideGiftButton === "boolean");
|
const ChatInput = findByName("ChatInput");
|
||||||
|
|
||||||
export default new class HideGiftButton {
|
export default new class HideGiftButton {
|
||||||
origState: boolean;
|
origState: boolean;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue