diff options
author | Lewis Crichton <lewi@lewisakura.moe> | 2023-03-01 20:35:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-01 21:35:08 +0100 |
commit | e6ccb751a04ce383c998d717196340c1b4b1da5f (patch) | |
tree | a0c82ba89fc1a1e41250cb2791b987001f42b175 /src/components/VencordSettings | |
parent | dfc7a15083188f07dd9921155dda8139c43a32eb (diff) | |
download | Vencord-e6ccb751a04ce383c998d717196340c1b4b1da5f.tar.gz Vencord-e6ccb751a04ce383c998d717196340c1b4b1da5f.tar.bz2 Vencord-e6ccb751a04ce383c998d717196340c1b4b1da5f.zip |
Fix for latest Discord Update (#550)
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Co-authored-by: Vendicated <vendicated@riseup.net>
Diffstat (limited to 'src/components/VencordSettings')
-rw-r--r-- | src/components/VencordSettings/BackupRestoreTab.tsx | 9 | ||||
-rw-r--r-- | src/components/VencordSettings/ThemesTab.tsx | 7 | ||||
-rw-r--r-- | src/components/VencordSettings/Updater.tsx | 13 | ||||
-rw-r--r-- | src/components/VencordSettings/index.tsx | 7 |
4 files changed, 20 insertions, 16 deletions
diff --git a/src/components/VencordSettings/BackupRestoreTab.tsx b/src/components/VencordSettings/BackupRestoreTab.tsx index 2ea0452..7a3729d 100644 --- a/src/components/VencordSettings/BackupRestoreTab.tsx +++ b/src/components/VencordSettings/BackupRestoreTab.tsx @@ -18,25 +18,26 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { Flex } from "@components/Flex"; +import { Margins } from "@utils/margins"; import { classes } from "@utils/misc"; import { downloadSettingsBackup, uploadSettingsBackup } from "@utils/settingsSync"; -import { Button, Card, Forms, Margins, Text } from "@webpack/common"; +import { Button, Card, Forms, Text } from "@webpack/common"; function BackupRestoreTab() { return ( - <Forms.FormSection title="Settings Sync" className={Margins.marginTop16}> + <Forms.FormSection title="Settings Sync" className={Margins.top16}> <Card className={classes("vc-settings-card", "vc-backup-restore-card")}> <Flex flexDirection="column"> <strong>Warning</strong> <span>Importing a settings file will overwrite your current settings.</span> </Flex> </Card> - <Text variant="text-md/normal" className={Margins.marginBottom8}> + <Text variant="text-md/normal" className={Margins.bottom8}> You can import and export your Vencord settings as a JSON file. This allows you to easily transfer your settings to another device, or recover your settings after reinstalling Vencord or Discord. </Text> - <Text variant="text-md/normal" className={Margins.marginBottom8}> + <Text variant="text-md/normal" className={Margins.bottom8}> Settings Export contains: <ul> <li>— Custom QuickCSS</li> diff --git a/src/components/VencordSettings/ThemesTab.tsx b/src/components/VencordSettings/ThemesTab.tsx index b2cf85b..b8381f7 100644 --- a/src/components/VencordSettings/ThemesTab.tsx +++ b/src/components/VencordSettings/ThemesTab.tsx @@ -19,9 +19,10 @@ import { useSettings } from "@api/settings"; import ErrorBoundary from "@components/ErrorBoundary"; import { Link } from "@components/Link"; +import { Margins } from "@utils/margins"; import { useAwaiter } from "@utils/misc"; import { findLazy } from "@webpack"; -import { Card, Forms, Margins, React, TextArea } from "@webpack/common"; +import { Card, Forms, React, TextArea } from "@webpack/common"; const TextAreaProps = findLazy(m => typeof m.textarea === "string"); @@ -51,7 +52,7 @@ function Validators({ themeLinks }: { themeLinks: string[]; }) { return ( <> - <Forms.FormTitle className={Margins.marginTop20} tag="h5">Validator</Forms.FormTitle> + <Forms.FormTitle className={Margins.top20} tag="h5">Validator</Forms.FormTitle> <Forms.FormText>This section will tell you whether your themes can successfully be loaded</Forms.FormText> <div> {themeLinks.map(link => ( @@ -93,7 +94,7 @@ export default ErrorBoundary.wrap(function () { <Forms.FormTitle tag="h5">Paste links to .css / .theme.css files here</Forms.FormTitle> <Forms.FormText>One link per line</Forms.FormText> <Forms.FormText>Make sure to use the raw links or github.io links!</Forms.FormText> - <Forms.FormDivider className={Margins.marginTop8 + " " + Margins.marginBottom8} /> + <Forms.FormDivider className={Margins.top8 + " " + Margins.bottom8} /> <Forms.FormTitle tag="h5">Find Themes:</Forms.FormTitle> <div style={{ marginBottom: ".5em" }}> <Link style={{ marginRight: ".5em" }} href="https://betterdiscord.app/themes"> diff --git a/src/components/VencordSettings/Updater.tsx b/src/components/VencordSettings/Updater.tsx index b5243f2..caed4f7 100644 --- a/src/components/VencordSettings/Updater.tsx +++ b/src/components/VencordSettings/Updater.tsx @@ -22,9 +22,10 @@ import { ErrorCard } from "@components/ErrorCard"; import { Flex } from "@components/Flex"; import { handleComponentFailed } from "@components/handleComponentFailed"; import { Link } from "@components/Link"; +import { Margins } from "@utils/margins"; import { classes, useAwaiter } from "@utils/misc"; import { changes, checkForUpdates, getRepo, isNewer, rebuild, update, updateError, UpdateLogger } from "@utils/updater"; -import { Alerts, Button, Card, Forms, Margins, Parser, React, Switch, Toasts } from "@webpack/common"; +import { Alerts, Button, Card, Forms, Parser, React, Switch, Toasts } from "@webpack/common"; import gitHash from "~git-hash"; @@ -109,14 +110,14 @@ function Updatable(props: CommonProps) { </ErrorCard> </> ) : ( - <Forms.FormText className={Margins.marginBottom8}> + <Forms.FormText className={Margins.bottom8}> {isOutdated ? `There are ${updates.length} Updates` : "Up to Date!"} </Forms.FormText> )} {isOutdated && <Changes updates={updates} {...props} />} - <Flex className={classes(Margins.marginBottom8, Margins.marginTop8)}> + <Flex className={classes(Margins.bottom8, Margins.top8)}> {isOutdated && <Button size={Button.Sizes.SMALL} disabled={isUpdating || isChecking} @@ -175,7 +176,7 @@ function Updatable(props: CommonProps) { function Newer(props: CommonProps) { return ( <> - <Forms.FormText className={Margins.marginBottom8}> + <Forms.FormText className={Margins.bottom8}> Your local copy has more recent commits. Please stash or reset them. </Forms.FormText> <Changes {...props} updates={changes} /> @@ -199,7 +200,7 @@ function Updater() { }; return ( - <Forms.FormSection className={Margins.marginTop16}> + <Forms.FormSection className={Margins.top16}> <Forms.FormTitle tag="h5">Updater Settings</Forms.FormTitle> <Switch value={settings.notifyAboutUpdates} @@ -225,7 +226,7 @@ function Updater() { </Link> )} (<HashLink hash={gitHash} repo={repo} disabled={repoPending} />)</Forms.FormText> - <Forms.FormDivider className={Margins.marginTop8 + " " + Margins.marginBottom8} /> + <Forms.FormDivider className={Margins.top8 + " " + Margins.bottom8} /> <Forms.FormTitle tag="h5">Updates</Forms.FormTitle> diff --git a/src/components/VencordSettings/index.tsx b/src/components/VencordSettings/index.tsx index acd81c3..6c946a1 100644 --- a/src/components/VencordSettings/index.tsx +++ b/src/components/VencordSettings/index.tsx @@ -20,6 +20,7 @@ import "./settingsStyles.css"; import { classNameFactory } from "@api/Styles"; import ErrorBoundary from "@components/ErrorBoundary"; +import { handleComponentFailed } from "@components/handleComponentFailed"; import { findByCodeLazy } from "@webpack"; import { Forms, SettingsRouter, Text } from "@webpack/common"; @@ -61,8 +62,8 @@ function Settings(props: SettingsProps) { <Text variant="heading-md/normal" tag="h2">Vencord Settings</Text> <TabBar - type={TabBar.Types.TOP} - look={TabBar.Looks.BRAND} + type="top" + look="brand" className={cl("tab-bar")} selectedItem={tab} onItemSelect={SettingsRouter.open} @@ -83,7 +84,7 @@ function Settings(props: SettingsProps) { } export default function (props: SettingsProps) { - return <ErrorBoundary> + return <ErrorBoundary onError={handleComponentFailed}> <Settings tab={props.tab} /> </ErrorBoundary>; } |