diff --git a/apps/dashboard/src/components/settings/Account/Billing/alerts/Alert.tsx b/apps/dashboard/src/components/settings/Account/Billing/alerts/Alert.tsx
index 328fe510c76..41605929b5c 100644
--- a/apps/dashboard/src/components/settings/Account/Billing/alerts/Alert.tsx
+++ b/apps/dashboard/src/components/settings/Account/Billing/alerts/Alert.tsx
@@ -1,5 +1,4 @@
"use client";
-
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { TrackedLinkTW } from "@/components/ui/tracked-link";
@@ -12,14 +11,15 @@ import {
useAccountUsage,
} from "@3rdweb-sdk/react/hooks/useApi";
import { useLoggedInUser } from "@3rdweb-sdk/react/hooks/useLoggedInUser";
-import { useDisclosure } from "@chakra-ui/react";
+import * as Sentry from "@sentry/nextjs";
import { OnboardingModal } from "components/onboarding/Modal";
import { format } from "date-fns";
import { useTrack } from "hooks/analytics/useTrack";
import { useLocalStorage } from "hooks/useLocalStorage";
import { ExternalLinkIcon, XIcon } from "lucide-react";
import { usePathname } from "next/navigation";
-import { useCallback, useMemo, useState } from "react";
+import { useCallback, useEffect, useMemo, useState } from "react";
+import { ErrorBoundary, type FallbackProps } from "react-error-boundary";
import { LazyOnboardingBilling } from "../../../../onboarding/LazyOnboardingBilling";
import { ManageBillingButton } from "../ManageButton";
import { RecurringPaymentFailureAlert } from "./RecurringPaymentFailureAlert";
@@ -301,7 +301,9 @@ export function BillingAlertsUI(props: {
}
return (
-
{alerts}
+
+ {alerts}
+
);
}
@@ -331,16 +333,11 @@ const AddPaymentNotification: React.FC = ({
// TODO: We should find a way to move this deeper into the
// TODO: ManageBillingButton component and set an optional field to override
const [paymentMethodSaving, setPaymentMethodSaving] = useState(false);
-
- const {
- onOpen: onPaymentMethodOpen,
- onClose: onPaymentMethodClose,
- isOpen: isPaymentMethodOpen,
- } = useDisclosure();
+ const [isPaymentMethodOpen, setIsPaymentMethodOpen] = useState(false);
const handlePaymentAdded = () => {
setPaymentMethodSaving(true);
- onPaymentMethodClose();
+ setIsPaymentMethodOpen(false);
};
const isBilling = ctaHref === "/dashboard/settings/billing";
@@ -353,7 +350,7 @@ const AddPaymentNotification: React.FC = ({
setIsPaymentMethodOpen(false)}
/>
@@ -361,13 +358,13 @@ const AddPaymentNotification: React.FC = ({
{description}
{showCTAs && (
-
+
{isBilling ? (
setIsPaymentMethodOpen(true)}
/>
) : (
)}
-