Move settings related to core
This commit is contained in:
parent
75192aa1d2
commit
584fb07a07
20 changed files with 33 additions and 32 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { NavigationNative, ReactNative as RN, clipboard } from "@metro/common";
|
||||
import { useProxy } from "@/lib/api/storage";
|
||||
import { HelpMessage, ErrorBoundary, Search } from "@ui/components";
|
||||
import { CardWrapper } from "@ui/settings/components/Card";
|
||||
import { CardWrapper } from "@/core/ui/components/Card";
|
||||
import { settings } from "@lib/settings";
|
||||
import { findByProps } from "@/lib/metro/filters";
|
||||
import { HTTP_REGEX_MULTI } from "@/lib/utils/constants";
|
||||
|
|
@ -4,7 +4,7 @@ import { MMKVManager } from "@lib/api/native/modules";
|
|||
import { getAssetIDByName } from "@/lib/api/assets";
|
||||
import { showToast } from "@ui/toasts";
|
||||
import { showConfirmationAlert } from "@ui/alerts";
|
||||
import Card, { CardWrapper } from "@ui/settings/components/Card";
|
||||
import Card, { CardWrapper } from "@/core/ui/components/Card";
|
||||
import { useProxy } from "@/lib/api/storage";
|
||||
import { ButtonColors } from "@/lib/utils/types";
|
||||
import { Strings, formatString } from "@/core/i18n";
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import { NavigationNative } from "@metro/common";
|
||||
import { useProxy } from "@/lib/api/storage";
|
||||
import { getAssetIDByName } from "@/lib/api/assets";
|
||||
import { getScreens } from "@ui/settings/data";
|
||||
import { getScreens } from "@/core/ui/settings/data";
|
||||
import { ErrorBoundary, Forms } from "@ui/components";
|
||||
import { settings } from "@lib/settings";
|
||||
import { Strings } from "@/core/i18n";
|
||||
|
|
@ -6,7 +6,7 @@ import { getAssetIDByName } from "@/lib/api/assets";
|
|||
import { showConfirmationAlert } from "@ui/alerts";
|
||||
import { showToast } from "@ui/toasts";
|
||||
import { settings } from "@lib/settings";
|
||||
import Card, { CardWrapper } from "@ui/settings/components/Card";
|
||||
import Card, { CardWrapper } from "@/core/ui/components/Card";
|
||||
import { ButtonColors } from "@/lib/utils/types";
|
||||
import { Strings, formatString } from "@/core/i18n";
|
||||
|
||||
|
|
@ -8,11 +8,11 @@ import { without } from "@lib/utils";
|
|||
import { getAssetIDByName } from "@/lib/api/assets";
|
||||
import { settings } from "@lib/settings";
|
||||
import ErrorBoundary from "@ui/components/ErrorBoundary";
|
||||
import InstallButton from "@ui/settings/components/InstallButton";
|
||||
import General from "@ui/settings/pages/General";
|
||||
import Plugins from "@ui/settings/pages/Plugins";
|
||||
import Themes from "@ui/settings/pages/Themes";
|
||||
import Developer from "@ui/settings/pages/Developer";
|
||||
import InstallButton from "@/core/ui/components/InstallButton";
|
||||
import General from "@/core/ui/settings/pages/General";
|
||||
import Plugins from "@/core/ui/settings/pages/Plugins";
|
||||
import Themes from "@/core/ui/settings/pages/Themes";
|
||||
import Developer from "@/core/ui/settings/pages/Developer";
|
||||
import { PROXY_PREFIX } from "@/lib/utils/constants";
|
||||
import { findByProps } from "@/lib/metro/filters";
|
||||
import { isThemeSupported } from "@/lib/api/native/loader";
|
||||
12
src/core/ui/settings/index.ts
Normal file
12
src/core/ui/settings/index.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// TODO: make settings patches part of the api
|
||||
import patchPanels from "@/core/ui/settings/patches/panels";
|
||||
import patchYou from "@/core/ui/settings/patches/you";
|
||||
|
||||
export default function initSettings() {
|
||||
const patches = [
|
||||
patchPanels(),
|
||||
patchYou(),
|
||||
]
|
||||
|
||||
return () => patches.forEach(p => p?.());
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import { ReactNative as RN } from "@metro/common";
|
||||
import { all } from "@/lib/api/assets";
|
||||
import { Forms, Search, ErrorBoundary } from "@ui/components";
|
||||
import AssetDisplay from "@ui/settings/components/AssetDisplay";
|
||||
import AssetDisplay from "@/core/ui/components/AssetDisplay";
|
||||
|
||||
const { FormDivider } = Forms;
|
||||
|
||||
|
|
@ -5,7 +5,7 @@ import { useProxy } from "@/lib/api/storage";
|
|||
import { getAssetIDByName } from "@/lib/api/assets";
|
||||
import { ErrorBoundary, Forms } from "@ui/components";
|
||||
import { settings, loaderConfig } from "@lib/settings";
|
||||
import AssetBrowser from "@ui/settings/pages/AssetBrowser";
|
||||
import AssetBrowser from "@/core/ui/settings/pages/AssetBrowser";
|
||||
import { semanticColors } from "@ui/color";
|
||||
import { getReactDevToolsProp, getReactDevToolsVersion, isLoaderConfigSupported, isReactDevToolsPreloaded } from "@/lib/api/native/loader";
|
||||
import { Strings } from "@/core/i18n";
|
||||
|
|
@ -5,7 +5,7 @@ import { useProxy } from "@/lib/api/storage";
|
|||
import { getAssetIDByName } from "@/lib/api/assets";
|
||||
import { Summary } from "@ui/components";
|
||||
import { settings } from "@lib/settings";
|
||||
import Version from "@ui/settings/components/Version";
|
||||
import Version from "@/core/ui/components/Version";
|
||||
import { findByProps } from "@lib/metro/filters";
|
||||
import { semanticColors } from "@ui/color";
|
||||
import { Strings } from "@/core/i18n";
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import { useProxy } from "@/lib/api/storage";
|
||||
import { BunnyPlugin, installPlugin, plugins } from "@lib/managers/plugins";
|
||||
import { settings } from "@lib/settings";
|
||||
import AddonPage from "@ui/settings/components/AddonPage";
|
||||
import PluginCard from "@ui/settings/components/PluginCard";
|
||||
import AddonPage from "@/core/ui/components/AddonPage";
|
||||
import PluginCard from "@/core/ui/components/PluginCard";
|
||||
import { Strings } from "@/core/i18n";
|
||||
|
||||
export default function Plugins() {
|
||||
|
|
@ -2,8 +2,8 @@ import { useProxy } from "@/lib/api/storage";
|
|||
import { Theme, installTheme, themes } from "@lib/managers/themes";
|
||||
import { Button } from "@ui/components";
|
||||
import { settings } from "@lib/settings";
|
||||
import AddonPage from "@ui/settings/components/AddonPage";
|
||||
import ThemeCard from "@ui/settings/components/ThemeCard";
|
||||
import AddonPage from "@/core/ui/components/AddonPage";
|
||||
import ThemeCard from "@/core/ui/components/ThemeCard";
|
||||
import { ButtonColors } from "@/lib/utils/types";
|
||||
import { Strings } from "@/core/i18n";
|
||||
|
||||
|
|
@ -2,8 +2,8 @@ import { i18n } from "@metro/common";
|
|||
import { findByName } from "@metro/filters";
|
||||
import { after } from "@lib/api/patcher";
|
||||
import { findInReactTree } from "@lib/utils";
|
||||
import { getPanelsScreens } from "@ui/settings/data";
|
||||
import SettingsSection from "@ui/settings/components/SettingsSection";
|
||||
import { getPanelsScreens } from "@/core/ui/settings/data";
|
||||
import SettingsSection from "@/core/ui/components/SettingsSection";
|
||||
|
||||
const screensModule = findByName("getScreens", false);
|
||||
const settingsModule = findByName("UserSettingsOverviewWrapper", false);
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { findByProps } from "@metro/filters";
|
||||
import { after, before } from "@lib/api/patcher";
|
||||
import { getScreens, getYouData } from "@ui/settings/data";
|
||||
import { getScreens, getYouData } from "@/core/ui/settings/data";
|
||||
import { i18n } from "@lib/metro/common";
|
||||
import { Strings } from "@/core/i18n";
|
||||
|
||||
|
|
@ -4,7 +4,7 @@ import { initPlugins } from "@lib/managers/plugins";
|
|||
import { patchChatBackground } from "@lib/managers/themes";
|
||||
import { patchAssets } from "@/lib/api/assets";
|
||||
import initSafeMode from "@ui/safeMode";
|
||||
import initSettings from "@ui/settings";
|
||||
import initSettings from "@/core/ui/settings";
|
||||
import initFixes from "@/core/fixes";
|
||||
import logger from "@lib/utils/logger";
|
||||
import initWindowObject from "@lib/windowObject";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
export * as alerts from "./alerts";
|
||||
export * as color from "./color";
|
||||
export * as toasts from "./toasts";
|
||||
export * as settings from "./settings";
|
||||
export * as settings from "../../core/ui/settings";
|
||||
export * as components from "./components";
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
import patchPanels from "@ui/settings/patches/panels";
|
||||
import patchYou from "@ui/settings/patches/you";
|
||||
|
||||
export default function initSettings() {
|
||||
const patches = [
|
||||
patchPanels(),
|
||||
patchYou(),
|
||||
]
|
||||
|
||||
return () => patches.forEach(p => p?.());
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue