Skip to content

Commit b173ad2

Browse files
committed
Remove duplicated in-app-wallet and account-abstraction settings UI from /connect layout (#5748)
## Problem solved Fixes: DASH-630 In-App wallet and Account abstraction settings are already available in project settings layout <!-- start pr-codex --> --- ## PR-Codex overview This PR primarily focuses on refactoring the `AccountAbstractionPage` and `SmartWallets` components by removing the `twAccount` property and associated logic, along with deleting unused configuration files. It streamlines the code and improves maintainability. ### Detailed summary - Deleted files: `page.tsx` and `loading.tsx` in `connect/in-app-wallets/config`. - Removed `twAccount` property from `AccountAbstractionPage` and `SmartWallets` components. - Updated `AccountAbstractionPage` to only fetch `team` and `project` data. - Removed `getValidAccount` function call. - Deleted `Sponsorship Policies` tab and related logic from `SmartWallets`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent f1cf2fa commit b173ad2

File tree

6 files changed

+2
-80
lines changed

6 files changed

+2
-80
lines changed

apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/account-abstraction/AccountAbstractionPage.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
33
import { TrackedLinkTW } from "@/components/ui/tracked-link";
44
import {
5-
type Account,
65
type ApiKeyService,
76
accountStatus,
87
} from "@3rdweb-sdk/react/hooks/useApi";
@@ -25,7 +24,6 @@ export function AccountAbstractionPage(props: {
2524
apiKeyServices: ApiKeyService[];
2625
billingStatus: "validPayment" | (string & {}) | null;
2726
tab?: string;
28-
twAccount: Account;
2927
}) {
3028
const { apiKeyServices } = props;
3129

@@ -81,11 +79,9 @@ export function AccountAbstractionPage(props: {
8179

8280
<SmartWallets
8381
smartWalletsLayoutSlug={`/team/${props.teamSlug}/${props.projectSlug}/connect/account-abstraction`}
84-
apiKeyServices={apiKeyServices}
8582
trackingCategory={TRACKING_CATEGORY}
8683
clientId={props.projectKey}
8784
tab={props.tab}
88-
twAccount={props.twAccount}
8985
/>
9086
</div>
9187
<div className="h-14" />

apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/account-abstraction/page.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { ChakraProviderSetup } from "@/components/ChakraProviderSetup";
44
import type { Metadata } from "next";
55
import { notFound, redirect } from "next/navigation";
66
import { getAbsoluteUrl } from "../../../../../../lib/vercel-utils";
7-
import { getValidAccount } from "../../../../../account/settings/getAccount";
87
import { getAPIKeyForProjectId } from "../../../../../api/lib/getAPIKeys";
98
import { AccountAbstractionPage } from "./AccountAbstractionPage";
109

@@ -14,10 +13,7 @@ export default async function Page(props: {
1413
}) {
1514
const { team_slug, project_slug } = await props.params;
1615

17-
const [account, team, project] = await Promise.all([
18-
getValidAccount(
19-
`/${team_slug}/${project_slug}/connect/account-abstraction`,
20-
),
16+
const [team, project] = await Promise.all([
2117
getTeamBySlug(team_slug),
2218
getProject(team_slug, project_slug),
2319
]);
@@ -45,7 +41,6 @@ export default async function Page(props: {
4541
projectKey={project.publishableKey}
4642
apiKeyServices={apiKey.services || []}
4743
tab={(await props.searchParams).tab}
48-
twAccount={account}
4944
/>
5045
</ChakraProviderSetup>
5146
);

apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/config/loading.tsx

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/config/page.tsx

Lines changed: 0 additions & 38 deletions
This file was deleted.

apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/layout.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ export default async function Layout(props: {
4545
path: `/team/${team_slug}/${project_slug}/connect/in-app-wallets/users`,
4646
exactMatch: true,
4747
},
48-
{
49-
name: "Configuration",
50-
path: `/team/${team_slug}/${project_slug}/connect/in-app-wallets/config`,
51-
exactMatch: true,
52-
},
5348
]}
5449
/>
5550

apps/dashboard/src/components/smart-wallets/index.tsx

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
11
"use client";
22

33
import { TabLinks } from "@/components/ui/tabs";
4-
import {
5-
type Account,
6-
type ApiKeyService,
7-
useUserOpUsageAggregate,
8-
} from "@3rdweb-sdk/react/hooks/useApi";
4+
import { useUserOpUsageAggregate } from "@3rdweb-sdk/react/hooks/useApi";
95
import { AccountAbstractionAnalytics } from "./AccountAbstractionAnalytics";
106
import { AccountAbstractionSummary } from "./AccountAbstractionAnalytics/AccountAbstractionSummary";
117
import { AccountFactories } from "./AccountFactories";
12-
import { AccountAbstractionSettingsPage } from "./SponsorshipPolicies";
138

149
interface SmartWalletsProps {
15-
apiKeyServices: ApiKeyService[];
1610
trackingCategory: string;
1711
clientId: string;
1812
smartWalletsLayoutSlug: string;
1913
tab?: string;
20-
twAccount: Account;
2114
}
2215

2316
export const SmartWallets: React.FC<SmartWalletsProps> = ({
24-
apiKeyServices,
2517
trackingCategory,
2618
clientId,
2719
smartWalletsLayoutSlug,
2820
tab = "analytics",
29-
twAccount,
3021
}) => {
3122
const aggregateUserOpUsageQuery = useUserOpUsageAggregate({
3223
clientId,
@@ -48,12 +39,6 @@ export const SmartWallets: React.FC<SmartWalletsProps> = ({
4839
isActive: tab === "analytics",
4940
isDisabled: false,
5041
},
51-
{
52-
name: "Sponsorship Policies",
53-
href: `${smartWalletsLayoutSlug}?tab=config`,
54-
isActive: tab === "config",
55-
isDisabled: false,
56-
},
5742
{
5843
name: "Account Factories",
5944
href: `${smartWalletsLayoutSlug}?tab=factories`,
@@ -72,14 +57,6 @@ export const SmartWallets: React.FC<SmartWalletsProps> = ({
7257
{tab === "factories" && (
7358
<AccountFactories trackingCategory={trackingCategory} />
7459
)}
75-
76-
{tab === "config" && (
77-
<AccountAbstractionSettingsPage
78-
apiKeyServices={apiKeyServices}
79-
trackingCategory={trackingCategory}
80-
twAccount={twAccount}
81-
/>
82-
)}
8360
</div>
8461
);
8562
};

0 commit comments

Comments
 (0)