aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-05-11 02:34:39 +0200
committerGitHub <noreply@github.com>2023-05-11 02:34:39 +0200
commitd5c35055f3f83efb7b72f1b028789e829c0a723b (patch)
tree08bdb984b841e4ade02de3261c766732eddec755
parentcb385d1b280551eb16f1f9836a93cc9bcc43da15 (diff)
downloadVencord-d5c35055f3f83efb7b72f1b028789e829c0a723b.tar.gz
Vencord-d5c35055f3f83efb7b72f1b028789e829c0a723b.tar.bz2
Vencord-d5c35055f3f83efb7b72f1b028789e829c0a723b.zip
experiments: Add a warning card to experiments page (#1097)
-rw-r--r--src/plugins/experiments.tsx26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/plugins/experiments.tsx b/src/plugins/experiments.tsx
index ed29aa7..cc8309d 100644
--- a/src/plugins/experiments.tsx
+++ b/src/plugins/experiments.tsx
@@ -17,7 +17,10 @@
*/
import { definePluginSettings } from "@api/Settings";
+import ErrorBoundary from "@components/ErrorBoundary";
+import { ErrorCard } from "@components/ErrorCard";
import { Devs } from "@utils/constants";
+import { Margins } from "@utils/margins";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { Forms, React } from "@webpack/common";
@@ -87,6 +90,13 @@ export default definePlugin({
match: /"staging"===window\.GLOBAL_ENV\.RELEASE_CHANNEL/,
replace: "true"
}
+ },
+ {
+ find: 'H1,title:"Experiments"',
+ replacement: {
+ match: 'title:"Experiments",children:[',
+ replace: "$&$self.WarningCard(),"
+ }
}
],
@@ -109,5 +119,19 @@ export default definePlugin({
</Forms.FormText>
</React.Fragment>
);
- }
+ },
+
+ WarningCard: ErrorBoundary.wrap(() => (
+ <ErrorCard id="vc-experiments-warning-card" className={Margins.bottom16}>
+ <Forms.FormTitle tag="h2">Hold on!!</Forms.FormTitle>
+
+ <Forms.FormText>
+ Experiments are unreleased Discord features. They might not work, or even break your client or get your account disabled.
+ </Forms.FormText>
+
+ <Forms.FormText className={Margins.top8}>
+ Only use experiments if you know what you're doing. Vencord is not responsible for any damage caused by enabling experiments.
+ </Forms.FormText>
+ </ErrorCard>
+ ), { noop: true })
});