diff --git a/src/core/plugins/quickInstall/forumPost.tsx b/src/core/plugins/quickInstall/forumPost.tsx index 3d99516..9e24568 100644 --- a/src/core/plugins/quickInstall/forumPost.tsx +++ b/src/core/plugins/quickInstall/forumPost.tsx @@ -7,9 +7,9 @@ import { installPlugin, plugins, removePlugin } from "@lib/managers/plugins"; import { installTheme, removeTheme, themes } from "@lib/managers/themes"; import { DISCORD_SERVER_ID, HTTP_REGEX_MULTI, PLUGINS_CHANNEL_ID, PROXY_PREFIX, THEMES_CHANNEL_ID } from "@lib/utils/constants"; import { lazyDestructure } from "@lib/utils/lazy"; +import { Button } from "@metro/common/components"; import { findByProps, findByPropsProxy } from "@metro/utils"; import { ErrorBoundary } from "@ui/components"; -import { Button } from "@ui/components/discord/Redesign"; import { showToast } from "@ui/toasts"; type PostType = "Plugin" | "Theme"; diff --git a/src/core/ui/components/AddonPage.tsx b/src/core/ui/components/AddonPage.tsx index 63f09f6..d27a6b0 100644 --- a/src/core/ui/components/AddonPage.tsx +++ b/src/core/ui/components/AddonPage.tsx @@ -6,10 +6,10 @@ import { settings } from "@lib/settings"; import { HTTP_REGEX_MULTI } from "@lib/utils/constants"; import { lazyDestructure } from "@lib/utils/lazy"; import { clipboard } from "@metro/common"; +import { HelpMessage } from "@metro/common/components"; import { findByProps, findByPropsProxy } from "@metro/utils"; import { showInputAlert } from "@ui/alerts"; import { ErrorBoundary, Search } from "@ui/components"; -import { HelpMessage } from "@ui/components/discord"; import fuzzysort from "fuzzysort"; import { createContext } from "react"; import { FlatList, View } from "react-native"; diff --git a/src/core/ui/components/AssetDisplay.tsx b/src/core/ui/components/AssetDisplay.tsx index 19779a2..429cebb 100644 --- a/src/core/ui/components/AssetDisplay.tsx +++ b/src/core/ui/components/AssetDisplay.tsx @@ -1,6 +1,6 @@ import { Asset } from "@lib/api/assets"; import { clipboard } from "@metro/common"; -import { FormRow } from "@ui/components/discord/Forms"; +import { LegacyFormRow } from "@metro/common/components"; import { showToast } from "@ui/toasts"; import { Image } from "react-native"; @@ -8,7 +8,7 @@ interface AssetDisplayProps { asset: Asset; } export default function AssetDisplay({ asset }: AssetDisplayProps) { return ( - } onPress={() => { diff --git a/src/core/ui/components/Card.tsx b/src/core/ui/components/Card.tsx index 434ce00..86bc54e 100644 --- a/src/core/ui/components/Card.tsx +++ b/src/core/ui/components/Card.tsx @@ -1,10 +1,9 @@ import { requireAssetIndex } from "@lib/api/assets"; import { lazyDestructure } from "@lib/utils/lazy"; import { ReactNative as RN } from "@metro/common"; +import { FormCheckbox, FormSwitch, IconButton, LegacyFormRow } from "@metro/common/components"; import { findByProps } from "@metro/utils"; import { semanticColors } from "@ui/color"; -import { FormRow } from "@ui/components/discord/Forms"; -import { FormCheckbox, FormSwitch, IconButton } from "@ui/components/discord/Redesign"; import { createStyles, TextStyleSheet } from "@ui/styles"; import { ImageBackground, View } from "react-native"; @@ -100,7 +99,7 @@ export default function Card(props: CardProps) { resizeMode="cover" imageStyle={styles.iconStyle} > - @@ -119,7 +118,7 @@ export default function Card(props: CardProps) { key: "CardOverflow", header: { title: props.overflowTitle, - icon: props.headerIcon && , + icon: props.headerIcon && , onClose: () => hideActionSheet(), }, options: props.overflowActions?.map(i => ({ ...i, icon: requireAssetIndex(i.icon) })), @@ -153,7 +152,7 @@ export default function Card(props: CardProps) { } /> - {props.descriptionLabel} diff --git a/src/core/ui/components/FontCard.tsx b/src/core/ui/components/FontCard.tsx index 396e667..44d2050 100644 --- a/src/core/ui/components/FontCard.tsx +++ b/src/core/ui/components/FontCard.tsx @@ -3,7 +3,7 @@ import { CardWrapper } from "@core/ui/components/Card"; import { requireAssetIndex } from "@lib/api/assets"; import { useProxy } from "@lib/api/storage"; import { FontDefinition, fonts, removeFont, selectFont } from "@lib/managers/fonts"; -import { FormCheckbox, IconButton, TableRow, TableRowGroup } from "@ui/components/discord/Redesign"; +import { FormCheckbox, IconButton, TableRow, TableRowGroup } from "@metro/common/components"; import { showToast } from "@ui/toasts"; import { useContext } from "react"; import { Pressable, View } from "react-native"; diff --git a/src/core/ui/components/Version.tsx b/src/core/ui/components/Version.tsx index 3fcb489..10e87bb 100644 --- a/src/core/ui/components/Version.tsx +++ b/src/core/ui/components/Version.tsx @@ -1,7 +1,6 @@ import { requireAssetIndex } from "@lib/api/assets"; import { clipboard } from "@metro/common"; -import { FormText } from "@ui/components/discord/Forms"; -import { TableRow } from "@ui/components/discord/Redesign"; +import { LegacyFormText, TableRow } from "@metro/common/components"; import { showToast } from "@ui/toasts"; interface VersionProps { @@ -15,7 +14,7 @@ export default function Version({ label, version, icon }: VersionProps) { } - trailing={{version}} + trailing={{version}} onPress={() => { clipboard.setString(`${label} - ${version}`); showToast.showCopyToClipboard(); diff --git a/src/core/ui/settings/pages/About.tsx b/src/core/ui/settings/pages/About.tsx index 5759a24..7a3efb8 100644 --- a/src/core/ui/settings/pages/About.tsx +++ b/src/core/ui/settings/pages/About.tsx @@ -3,7 +3,7 @@ import Version from "@core/ui/components/Version"; import { useProxy } from "@lib/api/storage"; import { getDebugInfo } from "@lib/debug"; import { settings } from "@lib/settings"; -import { Stack, TableRowGroup } from "@ui/components/discord/Redesign"; +import { Stack, TableRowGroup } from "@metro/common/components"; import { Platform, ScrollView } from "react-native"; export default function About() { diff --git a/src/core/ui/settings/pages/AssetBrowser.tsx b/src/core/ui/settings/pages/AssetBrowser.tsx index 2ad3e8c..05cab50 100644 --- a/src/core/ui/settings/pages/AssetBrowser.tsx +++ b/src/core/ui/settings/pages/AssetBrowser.tsx @@ -1,7 +1,7 @@ import AssetDisplay from "@core/ui/components/AssetDisplay"; import { assetsMap } from "@lib/api/assets"; +import { LegacyFormDivider } from "@metro/common/components"; import { ErrorBoundary, Search } from "@ui/components"; -import { FormDivider } from "@ui/components/discord/Forms"; import { FlatList, View } from "react-native"; export default function AssetBrowser() { @@ -17,7 +17,7 @@ export default function AssetBrowser() { a.name.includes(search) || a.id.toString() === search)} renderItem={({ item }) => } - ItemSeparatorComponent={FormDivider} + ItemSeparatorComponent={LegacyFormDivider} keyExtractor={item => item.name} /> diff --git a/src/core/ui/settings/pages/Developer.tsx b/src/core/ui/settings/pages/Developer.tsx index bb87aff..ac9c76e 100644 --- a/src/core/ui/settings/pages/Developer.tsx +++ b/src/core/ui/settings/pages/Developer.tsx @@ -8,11 +8,10 @@ import { connectToDebugger } from "@lib/debug"; import { loaderConfig, settings } from "@lib/settings"; import { lazyDestructure } from "@lib/utils/lazy"; import { NavigationNative } from "@metro/common"; +import { Button, LegacyFormText, Stack, TableRow, TableRowGroup, TableSwitchRow, TextInput } from "@metro/common/components"; import { findByProps } from "@metro/utils"; import { semanticColors } from "@ui/color"; import { ErrorBoundary } from "@ui/components"; -import { FormText } from "@ui/components/discord/Forms"; -import { Button, Stack, TableRow, TableRowGroup, TableSwitchRow, TextInput } from "@ui/components/discord/Redesign"; import { createStyles, TextStyleSheet } from "@ui/styles"; import { ScrollView, StyleSheet } from "react-native"; @@ -46,7 +45,7 @@ export default function Developer() { label={Strings.DEBUGGER_URL} placeholder="127.0.0.1:9090" size="md" - leadingIcon={() => ws://} + leadingIcon={() => ws://} defaultValue={settings.debuggerUrl} onChange={(v: string) => settings.debuggerUrl = v} /> diff --git a/src/core/ui/settings/pages/FontImporter.tsx b/src/core/ui/settings/pages/FontImporter.tsx index 47f0c59..db9be7d 100644 --- a/src/core/ui/settings/pages/FontImporter.tsx +++ b/src/core/ui/settings/pages/FontImporter.tsx @@ -4,9 +4,10 @@ import { createProxy, useProxy } from "@lib/api/storage"; import { FontDefinition, saveFont, validateFont } from "@lib/managers/fonts"; import { getCurrentTheme } from "@lib/managers/themes"; import { safeFetch } from "@lib/utils"; +import { NavigationNative } from "@metro/common"; +import { ActionSheet, BottomSheetTitleHeader, Button, IconButton, Stack, TableRow, TableRowGroup, Text, TextInput } from "@metro/common/components"; import { findByPropsProxy } from "@metro/utils"; import { ErrorBoundary } from "@ui/components"; -import { ActionSheet, BottomSheetTitleHeader, Button, IconButton, Stack, TableRow, TableRowGroup, Text, TextInput, useNavigation } from "@ui/components/discord/Redesign"; import { useMemo, useRef, useState } from "react"; import { ScrollView, View } from "react-native"; @@ -35,7 +36,7 @@ function RevengeFontsExtractor({ fonts, setName }: { const themeFonts = currentTheme!.fonts as Record; const [fontName, setFontName] = useState(guessFontName(Object.values(themeFonts))); - const [error, setError] = useState(undefined); + const [error, setError] = useState(undefined); return (""); const [saving, setSaving] = useState(false); - const [error, setError] = useState(undefined); + const [error, setError] = useState(undefined); return ; }) { const urlRef = useRef(); const [nameSet, setNameSet] = useState(false); - const [error, setError] = useState(); + const [error, setError] = useState(); return @@ -203,7 +204,7 @@ export default function FontImporter() { const memoEntry = useMemo(() => createProxy({}).proxy, []); const fontEntries: Record = useProxy(memoEntry); - const navigation = useNavigation(); + const navigation = NavigationNative.useNavigation(); return diff --git a/src/core/ui/settings/pages/Fonts.tsx b/src/core/ui/settings/pages/Fonts.tsx index 5f4ea41..b9a4e78 100644 --- a/src/core/ui/settings/pages/Fonts.tsx +++ b/src/core/ui/settings/pages/Fonts.tsx @@ -4,8 +4,8 @@ import FontCard from "@core/ui/components/FontCard"; import { useProxy } from "@lib/api/storage"; import { FontDefinition, fonts, installFont } from "@lib/managers/fonts"; import { settings } from "@lib/settings"; -import { FormText } from "@ui/components/discord/Forms"; -import { useNavigation } from "@ui/components/discord/Redesign"; +import { NavigationNative } from "@metro/common"; +import { LegacyFormText } from "@metro/common/components"; import { useEffect, useState } from "react"; import { TouchableOpacity } from "react-native"; @@ -17,7 +17,7 @@ export default function Plugins() { const [removeMode, setRemoveMode] = useState(false); - const navigation = useNavigation(); + const navigation = NavigationNative.useNavigation(); useEffect(() => { const onPressCallback = () => { @@ -26,9 +26,9 @@ export default function Plugins() { navigation.setOptions({ headerRight: () => - + {removeMode ? Strings.DONE : Strings.REMOVE} - + }); }, [removeMode]); diff --git a/src/core/ui/settings/pages/General.tsx b/src/core/ui/settings/pages/General.tsx index 4259b74..56e14c7 100644 --- a/src/core/ui/settings/pages/General.tsx +++ b/src/core/ui/settings/pages/General.tsx @@ -5,8 +5,8 @@ import { useProxy } from "@lib/api/storage"; import { getDebugInfo, toggleSafeMode } from "@lib/debug"; import { settings } from "@lib/settings"; import { DISCORD_SERVER, GITHUB } from "@lib/utils/constants"; -import { url } from "@metro/common"; -import { Stack, TableRow, TableRowGroup, TableSwitchRow, useNavigation } from "@ui/components/discord/Redesign"; +import { NavigationNative, url } from "@metro/common"; +import { Stack, TableRow, TableRowGroup, TableSwitchRow } from "@metro/common/components"; import { NativeModules, ScrollView } from "react-native"; import About from "./About"; @@ -15,7 +15,7 @@ export default function General() { useProxy(settings); const debugInfo = getDebugInfo(); - const navigation = useNavigation(); + const navigation = NavigationNative.useNavigation(); return ( diff --git a/src/core/ui/settings/pages/Themes.tsx b/src/core/ui/settings/pages/Themes.tsx index 2c04d8e..fa6e5c0 100644 --- a/src/core/ui/settings/pages/Themes.tsx +++ b/src/core/ui/settings/pages/Themes.tsx @@ -5,7 +5,7 @@ import { useProxy } from "@lib/api/storage"; import { installTheme, Theme, themes } from "@lib/managers/themes"; import { settings } from "@lib/settings"; import { ButtonColors } from "@lib/utils/types"; -import { Button } from "@ui/components/discord"; +import { Button } from "@metro/common/components"; export default function Themes() { useProxy(settings); diff --git a/src/core/vendettaObject.ts b/src/core/vendettaObject.ts index a3c742c..872f449 100644 --- a/src/core/vendettaObject.ts +++ b/src/core/vendettaObject.ts @@ -10,11 +10,11 @@ import { loaderConfig, settings } from "@lib/settings"; import * as utils from "@lib/utils"; import * as metro from "@metro"; import * as common from "@metro/common"; +import { Forms } from "@metro/common/components"; +import * as commonComponents from "@metro/common/components"; import * as alerts from "@ui/alerts"; import * as color from "@ui/color"; import * as components from "@ui/components"; -import { Forms } from "@ui/components/discord/Forms"; -import { CompatfulRedesign } from "@ui/components/discord/Redesign"; import { createThemedStyleSheet } from "@ui/styles"; import * as toasts from "@ui/toasts"; import SparkMD5 from "spark-md5"; @@ -64,7 +64,6 @@ export const initVendettaObject = (): any => { url: common.url, toasts: common.toasts, stylesheet: { - ...CompatfulRedesign, createThemedStyleSheet }, clipboard: common.clipboard, @@ -109,10 +108,10 @@ export const initVendettaObject = (): any => { components: { Forms, General: common.ReactNative, - Alert: components.discord.Alert, - Button: components.discord.Button, - HelpMessage: components.discord.HelpMessage, - SafeAreaView: components.discord.SafeAreaView, + Alert: commonComponents.Alert, + Button: commonComponents.Button, + HelpMessage: commonComponents.HelpMessage, + SafeAreaView: commonComponents.SafeAreaView, Summary: components.Summary, ErrorBoundary: components.ErrorBoundary, Codeblock: components.Codeblock, diff --git a/src/lib/ui/components/ErrorBoundary.tsx b/src/lib/ui/components/ErrorBoundary.tsx index debda61..a2009cd 100644 --- a/src/lib/ui/components/ErrorBoundary.tsx +++ b/src/lib/ui/components/ErrorBoundary.tsx @@ -1,8 +1,7 @@ import { Strings } from "@core/i18n"; import { React } from "@metro/common"; +import { Button, LegacyFormText } from "@metro/common/components"; import { Codeblock } from "@ui/components"; -import { Button } from "@ui/components/discord"; -import { FormText } from "@ui/components/discord/Forms"; import { createThemedStyleSheet } from "@ui/styles"; import { ScrollView } from "react-native"; @@ -43,16 +42,15 @@ export default class ErrorBoundary extends React.Component - {Strings.UH_OH} + {Strings.UH_OH} {this.state.error.name} {this.state.error.message} {this.state.error.stack && {this.state.error.stack} }