Skip to content

Commit c5fa3b1

Browse files
authored
Dashboard: Move In-app-wallets page (#7378)
1 parent 6113f3d commit c5fa3b1

File tree

116 files changed

+542
-370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+542
-370
lines changed

apps/dashboard/redirects.js

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,51 @@ const legacyDashboardToTeamRedirects = [
6262
},
6363
];
6464

65+
const projectRoute = "/team/:team_slug/:project_slug";
66+
67+
const projectPageRedirects = [
68+
{
69+
source: `${projectRoute}/connect/pay/:path*`,
70+
destination: `${projectRoute}/universal-bridge/:path*`,
71+
permanent: false,
72+
},
73+
{
74+
source: `${projectRoute}/connect/universal-bridge/:path*`,
75+
destination: `${projectRoute}/universal-bridge/:path*`,
76+
permanent: false,
77+
},
78+
{
79+
source: `${projectRoute}/connect/account-abstraction/:path*`,
80+
destination: `${projectRoute}/account-abstraction/:path*`,
81+
permanent: false,
82+
},
83+
{
84+
source: `${projectRoute}/connect/in-app-wallets/:path*`,
85+
destination: `${projectRoute}/wallets/:path*`,
86+
permanent: false,
87+
},
88+
{
89+
source: `${projectRoute}/engine/cloud/vault/:path*`,
90+
destination: `${projectRoute}/vault/:path*`,
91+
permanent: false,
92+
},
93+
{
94+
source: `${projectRoute}/engine/cloud/:path*`,
95+
destination: `${projectRoute}/transactions/:path*`,
96+
permanent: false,
97+
},
98+
{
99+
source: `${projectRoute}/assets/:path*`,
100+
destination: `${projectRoute}/tokens/:path*`,
101+
permanent: false,
102+
},
103+
{
104+
source: `${projectRoute}/nebula/:path*`,
105+
destination: projectRoute,
106+
permanent: false,
107+
},
108+
];
109+
65110
/** @type {import('next').NextConfig['redirects']} */
66111
async function redirects() {
67112
return [
@@ -326,14 +371,6 @@ async function redirects() {
326371
destination: "/",
327372
permanent: false,
328373
},
329-
// pay > universal-bridge redirect
330-
{
331-
source: "/team/:team_slug/:project_slug/connect/pay/:path*",
332-
destination:
333-
"/team/:team_slug/:project_slug/connect/universal-bridge/:path*",
334-
permanent: false,
335-
},
336-
337374
// all /learn/tutorials (and sub-routes) -> /learn/guides
338375
{
339376
source: "/learn/tutorials/:path*",
@@ -382,8 +419,8 @@ async function redirects() {
382419
destination: "/transactions",
383420
permanent: false,
384421
},
385-
386422
...legacyDashboardToTeamRedirects,
423+
...projectPageRedirects,
387424
];
388425
}
389426

apps/dashboard/src/@/analytics/report.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type { Team } from "../api/team";
1010
* ### Why do we need to report this event?
1111
* - To track the number of contracts deployed
1212
* - To track the number of contracts deployed on each chain
13-
* - To track if the contract was deployed on the asset page vs on the deploy page
13+
* - To track if the contract was deployed on the token page vs on the deploy page
1414
*
1515
* ### Who is responsible for this event?
1616
* @jnsdls
@@ -230,7 +230,7 @@ type AssetContractType = "DropERC20" | "DropERC1155" | "DropERC721";
230230

231231
/**
232232
* ### Why do we need to report this event?
233-
* - To track number of successful asset purchases from the asset page
233+
* - To track number of successful asset purchases from the token page
234234
* - To track which asset and contract types are being purchased the most
235235
*
236236
* ### Who is responsible for this event?
@@ -250,7 +250,7 @@ export function reportAssetBuySuccessful(properties: {
250250

251251
/**
252252
* ### Why do we need to report this event?
253-
* - To track number of failed asset purchases from the asset page
253+
* - To track number of failed asset purchases from the token page
254254
* - To track the errors that users encounter when trying to purchase an asset
255255
*
256256
* ### Who is responsible for this event?

apps/dashboard/src/@/components/blocks/Sidebar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export type SidebarBaseLink = {
99
label: React.ReactNode;
1010
exactMatch?: boolean;
1111
icon?: React.FC<{ className?: string }>;
12+
isActive?: (pathname: string) => boolean;
1213
};
1314

1415
export type SidebarLink =

apps/dashboard/src/@/components/blocks/SidebarLayout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ function RenderSidebarGroup(props: {
123123
className="flex items-center gap-2 text-muted-foreground text-sm hover:bg-accent"
124124
activeClassName="text-foreground bg-accent"
125125
exactMatch={link.exactMatch}
126+
isActive={link.isActive}
126127
onClick={() => {
127128
sidebar.setOpenMobile(false);
128129
}}

apps/dashboard/src/@/components/ui/NavLink.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ export type NavButtonProps = {
1111
href: string;
1212
exactMatch?: boolean;
1313
onClick?: () => void;
14+
isActive?: (pathname: string) => boolean;
1415
};
1516

1617
export function NavLink(props: React.PropsWithChildren<NavButtonProps>) {
1718
const pathname = usePathname();
18-
const isActive = pathname
19-
? props.exactMatch
20-
? pathname === props.href
21-
: pathname.startsWith(props.href)
22-
: false;
19+
const isActive = props.isActive
20+
? props.isActive(pathname)
21+
: pathname
22+
? props.exactMatch
23+
? pathname === props.href
24+
: pathname.startsWith(props.href)
25+
: false;
2326
return (
2427
<Link
2528
href={props.href}

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/primary-dashboard-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const PrimaryDashboardButton: React.FC<AddToDashboardCardProps> = ({
8787
rel="noopener noreferrer"
8888
className="gap-2"
8989
>
90-
View Asset Page <ExternalLinkIcon className="size-3.5" />
90+
View Token Page <ExternalLinkIcon className="size-3.5" />
9191
</Link>
9292
</Button>
9393
);

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/ContractOverviewPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ export const ContractOverviewPage: React.FC<ContractOverviewPageProps> = ({
4545
<div className="flex grow flex-col gap-10 overflow-hidden">
4646
{isErc20 && (
4747
<UpsellBannerCard
48-
title="Public asset page available"
49-
description="A public page is available for this contract for anyone to buy this asset"
48+
title="Public token page available"
49+
description="A public page is available for this contract for anyone to buy this token"
5050
cta={{
51-
text: "View asset page",
51+
text: "View token page",
5252
icon: <ExternalLinkIcon className="size-4" />,
5353
target: "_blank",
5454
link: `/${chainSlug}/${contract.address}`,

apps/dashboard/src/app/(app)/account/contracts/DeployedContractsPageHeader.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function DeployedContractsPageHeader(props: {
1616
const [importModalOpen, setImportModalOpen] = useState(false);
1717

1818
return (
19-
<div className="border-b">
19+
<div>
2020
<ImportModal
2121
client={props.client}
2222
isOpen={importModalOpen}
@@ -28,24 +28,28 @@ export function DeployedContractsPageHeader(props: {
2828
type="contract"
2929
/>
3030

31-
<div className="container flex max-w-7xl flex-col gap-3 py-10 lg:flex-row lg:items-center lg:justify-between">
31+
<div className="container flex max-w-7xl flex-col gap-3 pt-10 pb-5 lg:flex-row lg:items-center lg:justify-between">
3232
<div>
3333
<h1 className="font-semibold text-2xl tracking-tight lg:text-3xl">
3434
Contracts
3535
</h1>
36+
<p className="text-muted-foreground">
37+
Deploy and manage contracts for your project
38+
</p>
3639
</div>
3740
<div className="flex gap-3 [&>*]:grow">
3841
<Button
39-
className="gap-2 bg-card"
42+
className="gap-1.5 bg-card"
43+
size="sm"
4044
variant="outline"
4145
onClick={() => {
4246
setImportModalOpen(true);
4347
}}
4448
>
45-
<DownloadIcon className="size-4" />
49+
<DownloadIcon className="size-4 text-muted-foreground" />
4650
Import contract
4751
</Button>
48-
<Button asChild className="gap-2">
52+
<Button asChild className="gap-1.5" size="sm">
4953
<Link href="/explore">
5054
<PlusIcon className="size-4" />
5155
Deploy contract

apps/dashboard/src/app/(app)/account/contracts/_components/DeployedContractsPage.tsx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Spinner } from "@/components/ui/Spinner/Spinner";
33
import { ContractTable } from "components/contract-components/tables/contract-table";
44
import { Suspense } from "react";
55
import type { ThirdwebClient } from "thirdweb";
6-
import { DeployedContractsPageHeader } from "../DeployedContractsPageHeader";
76
import { DeployViaCLIOrImportCard } from "./DeployViaCLIOrImportCard";
87
import { getSortedDeployedContracts } from "./getSortedDeployedContracts";
98

@@ -16,24 +15,16 @@ export function DeployedContractsPage(props: {
1615
projectSlug: string;
1716
}) {
1817
return (
19-
<div className="flex grow flex-col">
20-
<DeployedContractsPageHeader
18+
<div className="container flex max-w-7xl grow flex-col">
19+
<Suspense fallback={<Loading />}>
20+
<DeployedContractsPageAsync {...props} />
21+
</Suspense>
22+
<div className="h-8" />
23+
<DeployViaCLIOrImportCard
24+
client={props.client}
2125
teamId={props.teamId}
2226
projectId={props.projectId}
23-
client={props.client}
2427
/>
25-
<div className="h-6" />
26-
<div className="container flex max-w-7xl grow flex-col">
27-
<Suspense fallback={<Loading />}>
28-
<DeployedContractsPageAsync {...props} />
29-
</Suspense>
30-
<div className="h-8" />
31-
<DeployViaCLIOrImportCard
32-
client={props.client}
33-
teamId={props.teamId}
34-
projectId={props.projectId}
35-
/>
36-
</div>
3728
</div>
3829
);
3930
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FooterLinksSection } from "../../components/footer/FooterLinksSection";
1+
import { FooterLinksSection } from "../components/footer/FooterLinksSection";
22

33
export function AAFooter() {
44
return (

0 commit comments

Comments
 (0)