Skip to content

Commit 12082fd

Browse files
committed
Dashboard: Fix autoconnect in /bridge page (#8271)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR simplifies the `TWAutoConnect` component by removing the optional `accountAbstraction` prop and streamlining its usage in the `BridgeProviders` component. ### Detailed summary - Removed the `accountAbstraction` prop from the `TWAutoConnect` component. - Updated the `TWAutoConnect` function signature to only require the `client` prop. - Integrated `TWAutoConnect` into the `BridgeProviders` component, passing the `thirdwebClient`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Streamlined the auto-connect component API so it only requires the client, removing an unused configuration parameter. * Integrated the simplified auto-connect into the app provider stack to ensure automatic wallet/client initialization earlier in the startup sequence. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 5ff6063 commit 12082fd

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
"use client";
22
import type { ThirdwebClient } from "thirdweb";
33
import { AutoConnect } from "thirdweb/react";
4-
import type { SmartWalletOptions } from "thirdweb/wallets";
54

6-
export function TWAutoConnect(props: {
7-
accountAbstraction?: SmartWalletOptions;
8-
client: ThirdwebClient;
9-
}) {
10-
return (
11-
<AutoConnect
12-
accountAbstraction={props.accountAbstraction}
13-
client={props.client}
14-
/>
15-
);
5+
export function TWAutoConnect(props: { client: ThirdwebClient }) {
6+
return <AutoConnect client={props.client} />;
167
}

apps/dashboard/src/app/bridge/components/client/Providers.client.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
import { ThemeProvider } from "next-themes";
33
import { ThirdwebProvider } from "thirdweb/react";
44
import { Toaster } from "@/components/ui/sonner";
5+
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
6+
import { TWAutoConnect } from "../../../(app)/components/autoconnect";
7+
8+
const thirdwebClient = getClientThirdwebClient();
59

610
export function BridgeProviders({ children }: { children: React.ReactNode }) {
711
return (
812
<ThirdwebProvider>
13+
<TWAutoConnect client={thirdwebClient} />
914
<ThemeProvider
1015
attribute="class"
1116
defaultTheme="dark"

0 commit comments

Comments
 (0)