From d5c35055f3f83efb7b72f1b028789e829c0a723b Mon Sep 17 00:00:00 2001 From: V Date: Thu, 11 May 2023 02:34:39 +0200 Subject: [PATCH] experiments: Add a warning card to experiments page (#1097) --- src/plugins/experiments.tsx | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) 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({ ); - } + }, + + WarningCard: ErrorBoundary.wrap(() => ( + + Hold on!! + + + Experiments are unreleased Discord features. They might not work, or even break your client or get your account disabled. + + + + Only use experiments if you know what you're doing. Vencord is not responsible for any damage caused by enabling experiments. + + + ), { noop: true }) });