Skip to content

Commit eeb672d

Browse files
committed
[TOOL-4842] Dashboard navigation changes (#7395)
<!-- ## 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 focuses on restructuring and renaming various components and pages within the application, particularly transitioning terminology from "assets" to "tokens" and reorganizing file paths for clarity. It also includes the deletion of unused files and adjustments in imports. ### Detailed summary - Deleted unused files related to `nebula` and `in-app-wallets`. - Renamed components and pages from "assets" to "tokens". - Updated file paths to reflect the new structure. - Adjusted imports for consistency with new paths. - Enhanced UI elements for better user experience. > The following files were skipped due to too many changes: `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/cloud/vault/components/create-vault-account.client.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/contracts/layout.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/cloud/analytics/ftux.client.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/dedicated/(general)/layout.tsx`, `apps/dashboard/redirects.js`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/contract-webhooks/contract-webhooks-page.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/cloud/server-wallets/components/try-it-out.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/cloud/layout.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/layout.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/vault/components/key-management.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx`, `apps/dashboard/src/components/pay/PayAnalytics/PayEmbedFTUX.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/cloud/server-wallets/wallet-table/wallet-table-ui.client.tsx`, `apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/page.tsx`, `packages/nebula/package.json`, `pnpm-lock.yaml` > ✨ 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 - **New Features** - Introduced a Vault section for secure key management, including a new layout and key management UI. - Added contract webhooks management with improved pages and navigation. - **Improvements** - Renamed "Assets" to "Tokens" and "In-App Wallets" to "Wallets" throughout the dashboard. - Updated sidebar navigation labels, icons, and link destinations for clarity and consistency. - Enhanced "Transactions" section, replacing previous "Engine" references and updating related routes and UI. - Refined onboarding and FTUX experiences with clearer terminology and improved instructional content. - Improved contract import and table UI with updated labels and empty state messages. - Enhanced Pay analytics with richer code examples and a more flexible FTUX component. - Streamlined redirects and updated URL paths to remove deprecated segments for smoother navigation. - Improved pagination display and active link detection in navigation components. - Adjusted layout spacing, button sizes, and typography for improved visual consistency. - Updated footer and sidebar styling for better user experience. - **Bug Fixes** - Fixed various redirect and navigation paths to align with new route structures. - Improved handling of pagination and active link states in navigation components. - **Removals** - Removed Nebula analytics pages, components, and related tracking utilities. - Deleted unused tracking properties and constants. - Removed outdated Vault key management component replaced by new implementation. - **Documentation** - Updated terminology in documentation and UI to reflect the shift from "assets" to "tokens". - Revised analytics event descriptions to use "token page" terminology. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 9667c74 commit eeb672d

File tree

146 files changed

+1045
-1485
lines changed

Some content is hidden

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

146 files changed

+1045
-1485
lines changed

apps/dashboard/redirects.js

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

65+
const projectRoute = "/team/:team_slug/:project_slug";
66+
67+
const projectPageRedirects = [
68+
{
69+
destination: `${projectRoute}/universal-bridge/:path*`,
70+
permanent: false,
71+
source: `${projectRoute}/connect/pay/:path*`,
72+
},
73+
{
74+
destination: `${projectRoute}/universal-bridge/:path*`,
75+
permanent: false,
76+
source: `${projectRoute}/connect/universal-bridge/:path*`,
77+
},
78+
{
79+
destination: `${projectRoute}/account-abstraction/:path*`,
80+
permanent: false,
81+
source: `${projectRoute}/connect/account-abstraction/:path*`,
82+
},
83+
{
84+
destination: `${projectRoute}/wallets/:path*`,
85+
permanent: false,
86+
source: `${projectRoute}/connect/in-app-wallets/:path*`,
87+
},
88+
{
89+
destination: `${projectRoute}/vault/:path*`,
90+
permanent: false,
91+
source: `${projectRoute}/engine/cloud/vault/:path*`,
92+
},
93+
{
94+
destination: `${projectRoute}/transactions/:path*`,
95+
permanent: false,
96+
source: `${projectRoute}/engine/cloud/:path*`,
97+
},
98+
{
99+
destination: `${projectRoute}/tokens/:path*`,
100+
permanent: false,
101+
source: `${projectRoute}/assets/:path*`,
102+
},
103+
{
104+
destination: projectRoute,
105+
permanent: false,
106+
source: `${projectRoute}/nebula/:path*`,
107+
},
108+
{
109+
source: `${projectRoute}/connect/analytics`,
110+
destination: `${projectRoute}`,
111+
permanent: false,
112+
},
113+
];
114+
65115
/** @type {import('next').NextConfig['redirects']} */
66116
async function redirects() {
67117
return [
@@ -326,14 +376,6 @@ async function redirects() {
326376
permanent: false,
327377
source: "/unlimited-wallets",
328378
},
329-
// pay > universal-bridge redirect
330-
{
331-
destination:
332-
"/team/:team_slug/:project_slug/connect/universal-bridge/:path*",
333-
permanent: false,
334-
source: "/team/:team_slug/:project_slug/connect/pay/:path*",
335-
},
336-
337379
// all /learn/tutorials (and sub-routes) -> /learn/guides
338380
{
339381
destination: "/learn/guides/:path*",
@@ -382,8 +424,8 @@ async function redirects() {
382424
permanent: false,
383425
source: "/engine",
384426
},
385-
386427
...legacyDashboardToTeamRedirects,
428+
...projectPageRedirects,
387429
];
388430
}
389431

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
@@ -226,7 +226,7 @@ type AssetContractType = "DropERC20" | "DropERC1155" | "DropERC721";
226226

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

247247
/**
248248
* ### Why do we need to report this event?
249-
* - To track number of failed asset purchases from the asset page
249+
* - To track number of failed asset purchases from the token page
250250
* - To track the errors that users encounter when trying to purchase an asset
251251
*
252252
* ### 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
exactMatch={link.exactMatch}
125125
href={link.href}
126+
isActive={link.isActive}
126127
onClick={() => {
127128
sidebar.setOpenMobile(false);
128129
}}

apps/dashboard/src/@/components/blocks/UpsellBannerCard.stories.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ function Story() {
1717
description="Upgrade to increase limits and access advanced features."
1818
icon={<RocketIcon className="size-5" />}
1919
title="Unlock more with thirdweb"
20-
trackingCategory="storybook"
21-
trackingLabel="green"
2220
/>
2321
</BadgeContainer>
2422

@@ -33,8 +31,6 @@ function Story() {
3331
description="Add additional space to your account."
3432
icon={<StarIcon className="size-5" />}
3533
title="Need more storage?"
36-
trackingCategory="storybook"
37-
trackingLabel="blue"
3834
/>
3935
</BadgeContainer>
4036

@@ -48,8 +44,6 @@ function Story() {
4844
}}
4945
description="Get early access to experimental features."
5046
title="Join the beta"
51-
trackingCategory="storybook"
52-
trackingLabel="purple"
5347
/>
5448
</BadgeContainer>
5549
</div>

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ type UpsellBannerCardProps = {
4444
target?: "_blank";
4545
link: string;
4646
};
47-
trackingCategory: string;
48-
trackingLabel: string;
4947
accentColor?: keyof typeof ACCENT;
5048
icon?: React.ReactNode;
5149
};

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

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

1516
export function NavLink(props: React.PropsWithChildren<NavButtonProps>) {
1617
const pathname = usePathname();
17-
const isActive = pathname
18-
? props.exactMatch
19-
? pathname === props.href
20-
: pathname.startsWith(props.href)
21-
: false;
18+
const isActive = props.isActive
19+
? props.isActive(pathname)
20+
: pathname
21+
? props.exactMatch
22+
? pathname === props.href
23+
: pathname.startsWith(props.href)
24+
: false;
2225
return (
2326
<Link
2427
className={cn(props.className, isActive && props.activeClassName)}

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
@@ -90,7 +90,7 @@ export const PrimaryDashboardButton: React.FC<AddToDashboardCardProps> = ({
9090
rel="noopener noreferrer"
9191
target="_blank"
9292
>
93-
View Asset Page <ExternalLinkIcon className="size-3.5" />
93+
View Token Page <ExternalLinkIcon className="size-3.5" />
9494
</Link>
9595
</Button>
9696
);

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,10 @@ export const ContractOverviewPage: React.FC<ContractOverviewPageProps> = ({
5050
icon: <ExternalLinkIcon className="size-4" />,
5151
link: `/${chainSlug}/${contract.address}`,
5252
target: "_blank",
53-
text: "View asset page",
53+
text: "View token page",
5454
}}
55-
description="A public page is available for this contract for anyone to buy this asset"
56-
title="Public asset page available"
57-
trackingCategory="erc20-contract"
58-
trackingLabel="view-asset-page"
55+
description="A public page is available for this contract for anyone to buy this token"
56+
title="Public token page available"
5957
/>
6058
)}
6159

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

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

1717
return (
18-
<div className="border-b">
18+
<div>
1919
<ImportModal
2020
client={props.client}
2121
isOpen={importModalOpen}
@@ -27,24 +27,28 @@ export function DeployedContractsPageHeader(props: {
2727
type="contract"
2828
/>
2929

30-
<div className="container flex max-w-7xl flex-col gap-3 py-10 lg:flex-row lg:items-center lg:justify-between">
30+
<div className="container flex max-w-7xl flex-col gap-3 pt-6 pb-5 lg:flex-row lg:items-center lg:justify-between">
3131
<div>
32-
<h1 className="font-semibold text-2xl tracking-tight lg:text-3xl">
32+
<h1 className="mb-1 font-semibold text-2xl tracking-tight lg:text-3xl">
3333
Contracts
3434
</h1>
35+
<p className="text-muted-foreground text-sm">
36+
Deploy and manage contracts for your project
37+
</p>
3538
</div>
3639
<div className="flex gap-3 [&>*]:grow">
3740
<Button
38-
className="gap-2 bg-card"
41+
className="gap-1.5 bg-card"
3942
onClick={() => {
4043
setImportModalOpen(true);
4144
}}
45+
size="sm"
4246
variant="outline"
4347
>
44-
<DownloadIcon className="size-4" />
48+
<DownloadIcon className="size-4 text-muted-foreground" />
4549
Import contract
4650
</Button>
47-
<Button asChild className="gap-2">
51+
<Button asChild className="gap-1.5" size="sm">
4852
<Link href="/explore">
4953
<PlusIcon className="size-4" />
5054
Deploy contract

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

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Suspense } from "react";
33
import type { ThirdwebClient } from "thirdweb";
44
import { ClientOnly } from "@/components/blocks/client-only";
55
import { Spinner } from "@/components/ui/Spinner/Spinner";
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
2124
client={props.client}
2225
projectId={props.projectId}
2326
teamId={props.teamId}
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-
projectId={props.projectId}
34-
teamId={props.teamId}
35-
/>
36-
</div>
3728
</div>
3829
);
3930
}

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/_components/FreePlanUpsellBannerUI.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ export function FreePlanUpsellBannerUI(props: {
2626
description="Upgrade to increase limits and access advanced features."
2727
icon={<RocketIcon className="size-5" />}
2828
title="Unlock more with thirdweb"
29-
trackingCategory="billingBanner"
30-
trackingLabel="freePlan_viewPlans"
3129
/>
3230
);
3331
}
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 (
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function AccountAbstractionLayout(props: {
1717
children: React.ReactNode;
1818
hasSmartWalletsWithoutBilling: boolean;
1919
}) {
20-
const smartWalletsLayoutSlug = `/team/${props.teamSlug}/${props.projectSlug}/connect/account-abstraction`;
20+
const smartWalletsLayoutSlug = `/team/${props.teamSlug}/${props.projectSlug}/account-abstraction`;
2121

2222
return (
2323
<div className="flex grow flex-col">
@@ -37,7 +37,7 @@ export function AccountAbstractionLayout(props: {
3737
rel="noopener noreferrer"
3838
target="_blank"
3939
>
40-
Learn more about Account Abstraction
40+
Learn more
4141
</UnderlineLink>
4242
</p>
4343
</div>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { getSortedDeployedContracts } from "@app/account/contracts/_components/getSortedDeployedContracts";
2+
import { getAuthToken } from "@app/api/lib/getAuthToken";
3+
import { loginRedirect } from "@app/login/loginRedirect";
14
import { DefaultFactoriesSection } from "components/smart-wallets/AccountFactories";
25
import { FactoryContracts } from "components/smart-wallets/AccountFactories/factory-contracts";
36
import { PlusIcon } from "lucide-react";
@@ -14,9 +17,6 @@ import { Button } from "@/components/ui/button";
1417
import { UnderlineLink } from "@/components/ui/UnderlineLink";
1518
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
1619
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
17-
import { getSortedDeployedContracts } from "../../../../../../../account/contracts/_components/getSortedDeployedContracts";
18-
import { getAuthToken } from "../../../../../../../api/lib/getAuthToken";
19-
import { loginRedirect } from "../../../../../../../login/loginRedirect";
2020

2121
export default async function Page(props: {
2222
params: Promise<{ team_slug: string; project_slug: string }>;
@@ -31,7 +31,7 @@ export default async function Page(props: {
3131

3232
if (!authToken) {
3333
loginRedirect(
34-
`/team/${params.team_slug}/${params.project_slug}/connect/account-abstraction/factories`,
34+
`/team/${params.team_slug}/${params.project_slug}/account-abstraction/factories`,
3535
);
3636
}
3737

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { getAuthToken } from "@app/api/lib/getAuthToken";
12
import {
23
getLastNDaysRange,
34
type Range,
@@ -10,7 +11,6 @@ import { getUserOpUsage } from "@/api/analytics";
1011
import { getProject } from "@/api/projects";
1112
import { getTeamBySlug } from "@/api/team";
1213
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
13-
import { getAuthToken } from "../../../../../../api/lib/getAuthToken";
1414
import { searchParamLoader } from "./search-params";
1515

1616
interface PageParams {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { getAuthToken } from "@app/api/lib/getAuthToken";
2+
import { getValidTeamPlan } from "@app/team/components/TeamHeader/getValidTeamPlan";
13
import { AccountAbstractionSettingsPage } from "components/smart-wallets/SponsorshipPolicies";
24
import { CircleAlertIcon } from "lucide-react";
35
import { redirect } from "next/navigation";
@@ -7,8 +9,6 @@ import { ChakraProviderSetup } from "@/components/ChakraProviderSetup";
79
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
810
import { UnderlineLink } from "@/components/ui/UnderlineLink";
911
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
10-
import { getAuthToken } from "../../../../../../../api/lib/getAuthToken";
11-
import { getValidTeamPlan } from "../../../../../../components/TeamHeader/getValidTeamPlan";
1212

1313
export default async function Page(props: {
1414
params: Promise<{ team_slug: string; project_slug: string }>;

0 commit comments

Comments
 (0)