Skip to content

Commit 8ef8db7

Browse files
refactor
1 parent 11610f7 commit 8ef8db7

File tree

13 files changed

+470
-556
lines changed

13 files changed

+470
-556
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/components/ProjectFTUX/ProjectFTUX.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function ProductsSection(props: {
234234
title: "Engine",
235235
description:
236236
"Scale your application with a backend server to read, write, and deploy contracts at production-grade.",
237-
href: `/team/${props.teamSlug}/~/engine`,
237+
href: `/team/${props.teamSlug}/${props.projectSlug}/engine`,
238238
icon: EngineIcon,
239239
trackingLabel: "engine",
240240
},

apps/dashboard/src/app/team/[team_slug]/[project_slug]/engine/analytics/analytics-page.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function TransactionsAnalyticsPageContent(props: {
1616
project_slug: string;
1717
team_slug: string;
1818
wallets?: Wallet[];
19+
expandTestTx?: boolean;
1920
}) {
2021
return (
2122
<ResponsiveSearchParamsProvider value={props.searchParams}>
@@ -33,8 +34,15 @@ export function TransactionsAnalyticsPageContent(props: {
3334
team_slug={props.team_slug}
3435
wallets={props.wallets ?? []}
3536
/>
36-
<SendTestTransaction wallets={props.wallets} />
37-
<TransactionsTable teamId={props.teamId} clientId={props.clientId} />
37+
<SendTestTransaction
38+
wallets={props.wallets}
39+
expanded={props.expandTestTx}
40+
/>
41+
<TransactionsTable
42+
teamId={props.teamId}
43+
clientId={props.clientId}
44+
wallets={props.wallets}
45+
/>
3846
</div>
3947
</div>
4048
</ResponsiveSearchParamsProvider>

apps/dashboard/src/app/team/[team_slug]/[project_slug]/engine/analytics/send-test-tx.client.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ type FormValues = z.infer<typeof formSchema>;
3333

3434
export function SendTestTransaction(props: {
3535
wallets?: Wallet[];
36+
expanded?: boolean;
3637
}) {
37-
const [isOpen, setIsOpen] = useState(false);
38+
const [isOpen, setIsOpen] = useState(props.expanded ?? false);
3839
const thirdwebClient = useThirdwebClient();
3940

4041
const form = useForm<FormValues>({
@@ -111,7 +112,7 @@ export function SendTestTransaction(props: {
111112
};
112113

113114
return (
114-
<div className="w-full space-y-2 rounded-md border p-3">
115+
<div className="w-full space-y-2 rounded-md border bg-card p-3">
115116
{/* Trigger Area */}
116117
<div
117118
role="button"
@@ -150,7 +151,7 @@ export function SendTestTransaction(props: {
150151
<Input
151152
id="secret-key"
152153
type="password"
153-
placeholder="Project Secret Key"
154+
placeholder="abcd....1234"
154155
{...form.register("projectSecretKey")}
155156
disabled={isLoading}
156157
className="text-xs"
@@ -163,7 +164,7 @@ export function SendTestTransaction(props: {
163164
<Input
164165
id="access-token"
165166
type="password"
166-
placeholder="Vault Access Token"
167+
placeholder="vt_act_1234....ABCD"
167168
{...form.register("accessToken")}
168169
disabled={isLoading}
169170
className="text-xs"
@@ -217,6 +218,7 @@ export function SendTestTransaction(props: {
217218
<div className="flex flex-1 flex-col gap-2">
218219
<p className="text-sm">Network</p>
219220
<SingleNetworkSelector
221+
className="bg-background"
220222
client={thirdwebClient}
221223
chainId={form.watch("chainId")}
222224
onChange={(chainId) => {
@@ -230,7 +232,7 @@ export function SendTestTransaction(props: {
230232
<Button
231233
type="submit"
232234
variant="primary"
233-
disabled={isLoading}
235+
disabled={isLoading || !form.formState.isValid}
234236
size="sm"
235237
className="w-full min-w-[200px] md:w-auto"
236238
>

apps/dashboard/src/app/team/[team_slug]/[project_slug]/engine/analytics/tx-table/tx-table-ui.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { ExternalLinkIcon, InfoIcon } from "lucide-react";
3535
import Link from "next/link";
3636
import { useState } from "react";
3737
import { ChainIconClient } from "../../../../../../../components/icons/ChainIcon";
38+
import type { Wallet } from "../../server-wallets/wallet-table/types";
3839
import type {
3940
Transaction,
4041
TransactionStatus,
@@ -45,6 +46,7 @@ import type {
4546
export function TransactionsTableUI(props: {
4647
getData: (params: { page: number }) => Promise<TransactionsResponse>;
4748
clientId: string;
49+
wallets?: Wallet[];
4850
}) {
4951
const [autoUpdate, setAutoUpdate] = useState(true);
5052
const [status, setStatus] = useState<TransactionStatus | undefined>(
@@ -58,6 +60,7 @@ export function TransactionsTableUI(props: {
5860
queryFn: () => props.getData({ page }),
5961
refetchInterval: autoUpdate ? 4_000 : false,
6062
placeholderData: keepPreviousData,
63+
enabled: !!props.wallets && props.wallets.length > 0,
6164
});
6265

6366
const transactions = transactionsQuery.data?.transactions ?? [];

apps/dashboard/src/app/team/[team_slug]/[project_slug]/engine/analytics/tx-table/tx-table.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
"use client";
22

33
import { engineCloudProxy } from "@/actions/proxies";
4+
import type { Wallet } from "../../server-wallets/wallet-table/types";
45
import { TransactionsTableUI } from "./tx-table-ui";
56
import type { TransactionsResponse } from "./types";
67

7-
export function TransactionsTable(props: { teamId: string; clientId: string }) {
8+
export function TransactionsTable(props: {
9+
teamId: string;
10+
clientId: string;
11+
wallets?: Wallet[];
12+
}) {
813
return (
914
<TransactionsTableUI
1015
getData={async ({ page }) => {
@@ -15,6 +20,7 @@ export function TransactionsTable(props: { teamId: string; clientId: string }) {
1520
});
1621
}}
1722
clientId={props.clientId}
23+
wallets={props.wallets}
1824
/>
1925
);
2026
}

apps/dashboard/src/app/team/[team_slug]/[project_slug]/engine/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { getProject } from "@/api/projects";
22
import { getTeamBySlug } from "@/api/team";
3-
import { createVaultClient, listEoas } from "@thirdweb-dev/vault-sdk";
3+
import { listEoas } from "@thirdweb-dev/vault-sdk";
44
import { notFound, redirect } from "next/navigation";
5-
import { THIRDWEB_VAULT_URL } from "../../../../../@/constants/env";
65
import { getAuthToken } from "../../../../api/lib/getAuthToken";
76
import { TransactionsAnalyticsPageContent } from "./analytics/analytics-page";
87
import { TransactionAnalyticsSummary } from "./analytics/summary";
8+
import { initVaultClient } from "./server-wallets/lib/vault-utils";
99
import type { Wallet } from "./server-wallets/wallet-table/types";
1010

1111
export default async function TransactionsAnalyticsPage(props: {
@@ -14,6 +14,7 @@ export default async function TransactionsAnalyticsPage(props: {
1414
from?: string | string[] | undefined;
1515
to?: string | string[] | undefined;
1616
interval?: string | string[] | undefined;
17+
expand_test_tx?: string | string[] | undefined;
1718
}>;
1819
}) {
1920
const [params, searchParams, authToken] = await Promise.all([
@@ -43,9 +44,7 @@ export default async function TransactionsAnalyticsPage(props: {
4344
(service) => service.name === "engineCloud",
4445
);
4546

46-
const vaultClient = await createVaultClient({
47-
baseUrl: THIRDWEB_VAULT_URL,
48-
});
47+
const vaultClient = await initVaultClient();
4948

5049
const managementAccessToken =
5150
projectEngineCloudService?.managementAccessToken;
@@ -78,6 +77,7 @@ export default async function TransactionsAnalyticsPage(props: {
7877
project_slug={params.project_slug}
7978
team_slug={params.team_slug}
8079
wallets={wallets}
80+
expandTestTx={searchParams.expand_test_tx === "true"}
8181
/>
8282
</div>
8383
);

0 commit comments

Comments
 (0)