Skip to content

Commit 6f381d7

Browse files
committed
[TOOL-3378] Dashboard: Add Contract to Project UI updates (#6233)
<!-- start pr-codex --> ## PR-Codex overview This PR focuses on refactoring and improving the structure of the dashboard application by removing obsolete files, enhancing component functionality, and updating UI elements for better user experience. ### Detailed summary - Deleted several unused files related to contract management. - Updated `className` properties for better styling consistency. - Added `accountAddress` prop to various components for enhanced functionality. - Introduced new hooks and functions for managing project contracts. - Improved error handling in contract import functionality. - Enhanced UI components for better responsiveness and clarity. > The following files were skipped due to too many changes: `apps/dashboard/src/components/contract-components/tables/cells.tsx`, `apps/dashboard/src/components/contract-components/contract-deploy-form/add-to-project-card.tsx`, `apps/dashboard/src/components/smart-wallets/AccountFactories/index.tsx`, `apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx`, `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/primary-dashboard-button.tsx`, `apps/dashboard/src/components/contract-components/tables/contract-table.tsx` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 0c5a51c commit 6f381d7

File tree

64 files changed

+1883
-1680
lines changed

Some content is hidden

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

64 files changed

+1883
-1680
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const Mobile: Story = {
2828

2929
function Story() {
3030
return (
31-
<div className="container flex max-w-[1000px] flex-col gap-8 lg:p-10">
31+
<div className="container flex max-w-[1000px] flex-col gap-8 py-10">
3232
<BadgeContainer label="Base">
3333
<DangerSettingCard
3434
title="This is a title"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Link from "next/link";
2+
import { cn } from "../../lib/utils";
3+
4+
type LinkProps = React.ComponentProps<typeof Link>;
5+
6+
export function UnderlineLink(props: LinkProps) {
7+
return (
8+
<Link
9+
{...props}
10+
className={cn(
11+
"underline decoration-muted-foreground/50 decoration-dotted underline-offset-[5px] hover:text-foreground hover:decoration-foreground hover:decoration-solid",
12+
props.className,
13+
)}
14+
/>
15+
);
16+
}

apps/dashboard/src/@/lib/DashboardRouter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function DashboardRouterTopProgressBarInner() {
117117
const width = isLoading ? progress : 100;
118118
return (
119119
<span
120-
className="fixed top-0 block h-[2px] bg-blue-500"
120+
className="fixed top-0 block h-[3px] bg-foreground"
121121
style={{
122122
opacity: isLoading ? "100" : "0",
123123
width: `${width}%`,

apps/dashboard/src/@3rdweb-sdk/react/hooks/useDashboardContractMetadata.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function useDashboardContractMetadata(contract: ThirdwebContract) {
1515
return useQuery({
1616
queryKey: ["contract-metadata-header", contract.chain.id, contract.address],
1717
queryFn: () => fetchDashboardContractMetadata(contract),
18+
refetchOnWindowFocus: false,
1819
});
1920
}
2021

apps/dashboard/src/@3rdweb-sdk/react/hooks/useRegistry.ts

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

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/contract-page-layout.client.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"use client";
22

33
import { useQuery } from "@tanstack/react-query";
4-
import type { ThirdwebContract } from "thirdweb";
4+
import type { ThirdwebClient, ThirdwebContract } from "thirdweb";
55
import type { ChainMetadata } from "thirdweb/chains";
6+
import type { MinimalTeamsAndProjects } from "../../../../../../components/contract-components/contract-deploy-form/add-to-project-card";
67
import { ErrorPage, LoadingPage } from "../_components/page-skeletons";
78
import { useContractPageMetadata } from "../_hooks/useContractPageMetadata";
89
import { getContractPageSidebarLinks } from "../_utils/getContractPageSidebarLinks";
@@ -13,6 +14,8 @@ export function ContractPageLayoutClient(props: {
1314
chainMetadata: ChainMetadata;
1415
contract: ThirdwebContract;
1516
children: React.ReactNode;
17+
teamsAndProjects: MinimalTeamsAndProjects | undefined;
18+
client: ThirdwebClient;
1619
}) {
1720
const metadataQuery = useContractPageMetadata(props.contract);
1821
const headerMetadataQuery = useQuery({

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/contract-page-layout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import type { SidebarLink } from "@/components/blocks/Sidebar";
33
import { SidebarLayout } from "@/components/blocks/SidebarLayout";
44
import type { DashboardContractMetadata } from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata";
55
import { DeprecatedAlert } from "components/shared/DeprecatedAlert";
6-
import type { ThirdwebContract } from "thirdweb";
6+
import type { ThirdwebClient, ThirdwebContract } from "thirdweb";
77
import type { ChainMetadata } from "thirdweb/chains";
8+
import type { MinimalTeamsAndProjects } from "../../../../../../components/contract-components/contract-deploy-form/add-to-project-card";
89
import { ContractMetadata } from "./contract-metadata";
910
import { PrimaryDashboardButton } from "./primary-dashboard-button";
1011

@@ -14,6 +15,8 @@ export function ContractPageLayout(props: {
1415
children: React.ReactNode;
1516
sidebarLinks: SidebarLink[];
1617
dashboardContractMetadata: DashboardContractMetadata | undefined;
18+
client: ThirdwebClient;
19+
teamsAndProjects: MinimalTeamsAndProjects | undefined;
1720
externalLinks:
1821
| {
1922
name: string;
@@ -27,6 +30,8 @@ export function ContractPageLayout(props: {
2730
sidebarLinks,
2831
dashboardContractMetadata,
2932
externalLinks,
33+
teamsAndProjects,
34+
client,
3035
} = props;
3136

3237
return (
@@ -49,6 +54,8 @@ export function ContractPageLayout(props: {
4954
chainSlug: chainMetadata.slug,
5055
contractAddress: contract.address,
5156
}}
57+
teamsAndProjects={teamsAndProjects}
58+
client={client}
5259
/>
5360
</div>
5461
<DeprecatedAlert chain={chainMetadata} />

0 commit comments

Comments
 (0)