fix(polyfill/vendetta): pass the right Button component

This commit is contained in:
amsyarasyiq 2024-06-02 14:35:14 +08:00
parent 5a5639c7a8
commit 8a4d5fc0f3
3 changed files with 7 additions and 6 deletions

View file

@ -142,8 +142,8 @@ export const initVendettaObject = (): any => {
components: {
Forms,
General: common.ReactNative,
Alert: commonComponents.Alert,
Button: commonComponents.Button,
Alert: commonComponents.LegacyAlert,
Button: commonComponents.CompatButton,
HelpMessage: (...props: any[]) => <commonComponents.HelpMessage {...props} />,
SafeAreaView: (...props: any[]) => <commonComponents.SafeAreaView {...props} />,
Summary: components.Summary,

View file

@ -1,5 +1,5 @@
import { ButtonColors } from "@lib/utils/types";
import { Alert, LegacyFormInput } from "@metro/common/components";
import { LegacyAlert, LegacyFormInput } from "@metro/common/components";
import { findByPropsProxy } from "@metro/utils";
const Alerts = findByPropsProxy("openLazy", "close");
@ -30,7 +30,7 @@ export default function InputAlert({ title, confirmText, confirmColor, onConfirm
}
return (
<Alert
<LegacyAlert
title={title}
confirmText={confirmText}
confirmColor={confirmColor}
@ -54,6 +54,6 @@ export default function InputAlert({ title, confirmText, confirmColor, onConfirm
showBorder={true}
style={{ alignSelf: "stretch" }}
/>
</Alert>
</LegacyAlert>
);
}

View file

@ -14,9 +14,10 @@ const findSingular = (prop: string) => proxyLazy(() => findExports(bySingularPro
const findProp = (prop: string) => proxyLazy(() => findByProps(prop)[prop]);
// Discord
export const Alert = findByDisplayNameProxy("FluxContainer(Alert)");
export const LegacyAlert = findByDisplayNameProxy("FluxContainer(Alert)");
export const CompatButton = findByPropsProxy("Looks", "Colors", "Sizes");
export const HelpMessage = findByNameProxy("HelpMessage");
// React Native's included SafeAreaView only adds padding on iOS.
export const SafeAreaView = proxyLazy(() => findByProps("useSafeAreaInsets").SafeAreaView);