Skip to content

Commit

Permalink
fix(polyfill/vendetta): pass the right Button component
Browse files Browse the repository at this point in the history
  • Loading branch information
pylixonly committed Jun 2, 2024
1 parent 5a5639c commit 8a4d5fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/core/polyfills/vendettaObject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/ui/components/InputAlert.tsx
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -30,7 +30,7 @@ export default function InputAlert({ title, confirmText, confirmColor, onConfirm
}

return (
<Alert
<LegacyAlert
title={title}
confirmText={confirmText}
confirmColor={confirmColor}
Expand All @@ -54,6 +54,6 @@ export default function InputAlert({ title, confirmText, confirmColor, onConfirm
showBorder={true}
style={{ alignSelf: "stretch" }}
/>
</Alert>
</LegacyAlert>
);
}
3 changes: 2 additions & 1 deletion src/metro/common/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8a4d5fc

Please sign in to comment.