Skip to content

Commit 243000b

Browse files
committed
Move /connect/account-abstraction to app router
1 parent a7c947d commit 243000b

File tree

3 files changed

+40
-51
lines changed

3 files changed

+40
-51
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { ChakraProviderSetup } from "@/components/ChakraProviderSetup";
2+
import type { Metadata } from "next";
3+
import { Suspense } from "react";
4+
import { getAbsoluteUrl } from "../../../../../lib/vercel-utils";
5+
6+
export default function Layout(props: { children: React.ReactNode }) {
7+
return (
8+
<ChakraProviderSetup>
9+
<Suspense fallback={null}>{props.children}</Suspense>
10+
</ChakraProviderSetup>
11+
);
12+
}
13+
14+
const seo = {
15+
title: "The Complete Account Abstraction Toolkit | thirdweb",
16+
desc: "Add account abstraction to your web3 app & unlock powerful features for seamless onboarding, customizable transactions, & maximum security. Get started.",
17+
};
18+
19+
export const metadata: Metadata = {
20+
title: seo.title,
21+
description: seo.desc,
22+
openGraph: {
23+
title: seo.title,
24+
description: seo.desc,
25+
images: [
26+
{
27+
url: `${getAbsoluteUrl()}/assets/og-image/dashboard-wallets-smart-wallet.png`,
28+
width: 1200,
29+
height: 630,
30+
alt: seo.title,
31+
},
32+
],
33+
},
34+
};

apps/dashboard/src/pages/dashboard/connect/account-abstraction.tsx renamed to apps/dashboard/src/app/(dashboard)/dashboard/connect/account-abstraction/page.tsx

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,16 @@ import {
99
useApiKeys,
1010
} from "@3rdweb-sdk/react/hooks/useApi";
1111
import { useLoggedInUser } from "@3rdweb-sdk/react/hooks/useLoggedInUser";
12-
import { AppLayout } from "components/app-layouts/app";
1312
import { SmartWalletsBillingAlert } from "components/settings/ApiKeys/Alerts";
1413
import { ApiKeysMenu } from "components/settings/ApiKeys/Menu";
1514
import { NoApiKeys } from "components/settings/ApiKeys/NoApiKeys";
1615
import { ConnectSDKCard } from "components/shared/ConnectSDKCard";
1716
import { SmartWallets } from "components/smart-wallets";
18-
import { getAbsoluteUrl } from "lib/vercel-utils";
1917
import { CircleAlertIcon } from "lucide-react";
20-
import { NextSeo } from "next-seo";
21-
import { useRouter } from "next/router";
22-
import { PageId } from "page-id";
18+
import { useSearchParams } from "next/navigation";
2319
import { useMemo, useState } from "react";
2420
import { useActiveWalletChain } from "thirdweb/react";
25-
import type { ThirdwebNextPage } from "utils/types";
26-
import { ConnectSidebarLayout } from "../../../app/(dashboard)/dashboard/connect/DashboardConnectLayout";
27-
import { isOpChainId } from "../../../app/team/[team_slug]/[project_slug]/connect/account-abstraction/isOpChain";
21+
import { isOpChainId } from "../../../../team/[team_slug]/[project_slug]/connect/account-abstraction/isOpChain";
2822

2923
const TRACKING_CATEGORY = "smart-wallet";
3024

@@ -33,9 +27,9 @@ export type SmartWalletFormData = {
3327
clientId: string;
3428
};
3529

36-
const DashboardConnectAccountAbstraction: ThirdwebNextPage = () => {
37-
const router = useRouter();
38-
const defaultClientId = router.query.clientId?.toString();
30+
export default function Page() {
31+
const searchParams = useSearchParams();
32+
const defaultClientId = searchParams?.get("clientId");
3933
const looggedInUserQuery = useLoggedInUser();
4034
const keysQuery = useApiKeys();
4135
const [selectedKey_, setSelectedKey] = useState<undefined | ApiKey>();
@@ -80,32 +74,10 @@ const DashboardConnectAccountAbstraction: ThirdwebNextPage = () => {
8074

8175
const isOpChain = chain?.id ? isOpChainId(chain.id) : false;
8276

83-
const seo = {
84-
title: "The Complete Account Abstraction Toolkit | thirdweb",
85-
desc: "Add account abstraction to your web3 app & unlock powerful features for seamless onboarding, customizable transactions, & maximum security. Get started.",
86-
};
87-
8877
const isPending = looggedInUserQuery.isPending || keysQuery.isPending;
8978

9079
return (
9180
<div className="flex flex-col gap-10">
92-
<NextSeo
93-
title={seo.title}
94-
description={seo.desc}
95-
openGraph={{
96-
title: seo.title,
97-
description: seo.desc,
98-
images: [
99-
{
100-
url: `${getAbsoluteUrl()}/assets/og-image/dashboard-wallets-smart-wallet.png`,
101-
width: 1200,
102-
height: 630,
103-
alt: seo.title,
104-
},
105-
],
106-
}}
107-
/>
108-
10981
<div className="flex flex-col content-start justify-between gap-4 lg:flex-row">
11082
<div className="flex flex-col gap-1.5">
11183
<h1 className="font-semibold text-2xl tracking-tight lg:text-3xl">
@@ -181,19 +153,4 @@ const DashboardConnectAccountAbstraction: ThirdwebNextPage = () => {
181153
/>
182154
</div>
183155
);
184-
};
185-
186-
DashboardConnectAccountAbstraction.getLayout = (page, props) => (
187-
<AppLayout
188-
{...props}
189-
pageContainerClassName="!max-w-full !px-0"
190-
mainClassName="!pt-0"
191-
>
192-
<ConnectSidebarLayout>{page}</ConnectSidebarLayout>
193-
</AppLayout>
194-
);
195-
196-
DashboardConnectAccountAbstraction.pageId =
197-
PageId.DashboardConnectAccountAbstraction;
198-
199-
export default DashboardConnectAccountAbstraction;
156+
}

apps/dashboard/src/page-id.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ export enum PageId {
9696
// thirdweb.com/dashboard/infrastructure/storage
9797
DashboardSettingsStorage = "dashboard-storage",
9898

99-
// thirdweb.com/dashboard/connect/smart-wallet
100-
DashboardConnectAccountAbstraction = "dashboard-wallets-smart-wallet",
10199
// thirdweb.com/dashboard/contracts/build
102100
DashboardContractsBuild = "dashboard-contracts-build",
103101

0 commit comments

Comments
 (0)