chore: proxification
This commit is contained in:
parent
b489aea48a
commit
0d6462c226
4 changed files with 8 additions and 8 deletions
|
|
@ -12,7 +12,7 @@ import { Author } from "@lib/utils/types";
|
|||
import { chroma } from "@metro/common";
|
||||
import { byMutableProp } from "@metro/filters";
|
||||
import { findExports } from "@metro/finders";
|
||||
import { findByNameProxy, findByPropsProxy, findByStoreName } from "@metro/utils";
|
||||
import { findByNameProxy, findByPropsProxy, findByStoreNameProxy } from "@metro/utils";
|
||||
import { ImageBackground, Platform, processColor } from "react-native";
|
||||
|
||||
export interface ThemeData {
|
||||
|
|
@ -45,7 +45,7 @@ export const color = findByPropsProxy("SemanticColor");
|
|||
|
||||
const appearanceManager = findByPropsProxy("updateTheme");
|
||||
const mmkvStorage = findByPropsProxy("storage")?.parseResolve ? findByPropsProxy("storage") : findByPropsProxy("impl").impl;
|
||||
const ThemeStore = findByStoreName("ThemeStore");
|
||||
const ThemeStore = findByStoreNameProxy("ThemeStore");
|
||||
const formDividerModule = findByPropsProxy("DIVIDER_COLORS");
|
||||
|
||||
export const themes = wrapSync(createStorage<Record<string, Theme>>(createMMKVBackend("VENDETTA_THEMES")));
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { color } from "@lib/managers/themes";
|
||||
import { constants } from "@metro/common";
|
||||
import { findByStoreName } from "@metro/utils";
|
||||
import { findByStoreNameProxy } from "@metro/utils";
|
||||
|
||||
//! This module is only found on 165.0+, under the assumption that iOS 165.0 is the same as Android 165.0.
|
||||
//* In 167.1, most if not all traces of the old color modules were removed.
|
||||
|
|
@ -17,7 +17,7 @@ export const semanticColors = (color?.default?.colors ?? constants?.ThemeColorMa
|
|||
//* Note that constants.Colors does still appear to exist on newer versions despite Discord not internally using it - what the fuck?
|
||||
export const rawColors = (color?.default?.unsafe_rawColors ?? constants?.Colors) as Record<string, string>;
|
||||
|
||||
const ThemeStore = findByStoreName("ThemeStore");
|
||||
const ThemeStore = findByStoreNameProxy("ThemeStore");
|
||||
const colorResolver = color.default.meta ??= color.default.internal;
|
||||
|
||||
export function isSemanticColor(sym: any): boolean {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { findByDisplayName, findByNameProxy, findByPropsProxy } from "@metro/utils";
|
||||
import { findByDisplayNameProxy, findByNameProxy, findByPropsProxy } from "@metro/utils";
|
||||
|
||||
export * as Forms from "./Forms";
|
||||
export * as Redesign from "./Redesign";
|
||||
|
||||
// Discord
|
||||
export const Alert = findByDisplayName("FluxContainer(Alert)");
|
||||
export const Alert = findByDisplayNameProxy("FluxContainer(Alert)");
|
||||
export const Button = findByPropsProxy("Looks", "Colors", "Sizes") as React.ComponentType<any> & { Looks: any, Colors: any, Sizes: any; };
|
||||
export const HelpMessage = findByNameProxy("HelpMessage");
|
||||
// React Native's included SafeAreaView only adds padding on iOS.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Dispatcher } from "@metro/types";
|
||||
import { findByFilePath, findByPropsProxy } from "@metro/utils";
|
||||
import { findByFilePathProxy, findByPropsProxy } from "@metro/utils";
|
||||
|
||||
// Discord
|
||||
export const constants = findByPropsProxy("Fonts", "Permissions");
|
||||
|
|
@ -11,7 +11,7 @@ export const assets = findByPropsProxy("registerAsset");
|
|||
export const invites = findByPropsProxy("acceptInviteAndTransitionToInviteChannel");
|
||||
export const commands = findByPropsProxy("getBuiltInCommands");
|
||||
export const navigation = findByPropsProxy("pushLazy");
|
||||
export const toasts = findByFilePath("modules/toast/native/ToastActionCreators.tsx").default;
|
||||
export const toasts = findByFilePathProxy("modules/toast/native/ToastActionCreators.tsx").default;
|
||||
export const messageUtil = findByPropsProxy("sendBotMessage");
|
||||
export const navigationStack = findByPropsProxy("createStackNavigator");
|
||||
export const NavigationNative = findByPropsProxy("NavigationContainer");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue