Skip to content

Commit 3d1c321

Browse files
committed
[TOOL-4642] Fix useTxNotifications errors not shown in project contract pages (#7259)
<!-- ## 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 adding an `ErrorProvider` wrapper around the layout of the `ContractLayout` component to handle errors more effectively. ### Detailed summary - Added import for `ErrorProvider`. - Wrapped the main layout in an `ErrorProvider`. - Removed the previous layout structure while integrating the `ErrorProvider`. - Maintained the structure of `TeamHeaderLoggedIn`, `SharedContractLayout`, `SaveLastUsedProject`, and `AppFooter` within the new error handling context. > ✨ 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** - Improved error handling on the contract page with the addition of enhanced error context support. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 810ec6e commit 3d1c321

File tree

1 file changed

+28
-25
lines changed
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]

1 file changed

+28
-25
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/layout.tsx

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
55
import { redirect } from "next/navigation";
66
import { SaveLastUsedProject } from "../../../(sidebar)/components/SaveLastUsedProject";
77
import { SharedContractLayout } from "../../../../../../(dashboard)/(chain)/[chain_id]/[contractAddress]/shared-layout";
8+
import { ErrorProvider } from "../../../../../../../../contexts/error-handler";
89
import { getValidAccount } from "../../../../../../account/settings/getAccount";
910
import {
1011
getAuthToken,
@@ -59,31 +60,33 @@ export default async function ContractLayout(props: {
5960
});
6061

6162
return (
62-
<div className="flex min-h-dvh flex-col bg-background">
63-
<div className="border-border border-b bg-card">
64-
<TeamHeaderLoggedIn
65-
currentProject={project}
66-
currentTeam={team}
67-
teamsAndProjects={teamsAndProjects}
68-
account={account}
69-
accountAddress={accountAddress}
70-
client={client}
71-
/>
63+
<ErrorProvider>
64+
<div className="flex min-h-dvh flex-col bg-background">
65+
<div className="border-border border-b bg-card">
66+
<TeamHeaderLoggedIn
67+
currentProject={project}
68+
currentTeam={team}
69+
teamsAndProjects={teamsAndProjects}
70+
account={account}
71+
accountAddress={accountAddress}
72+
client={client}
73+
/>
74+
</div>
75+
<SharedContractLayout
76+
contractAddress={params.contractAddress}
77+
chainIdOrSlug={params.chainIdOrSlug}
78+
authToken={authToken}
79+
projectMeta={{
80+
teamId: team.id,
81+
projectSlug: params.project_slug,
82+
teamSlug: params.team_slug,
83+
}}
84+
>
85+
{props.children}
86+
</SharedContractLayout>
87+
<SaveLastUsedProject projectId={project.id} teamId={team.id} />
88+
<AppFooter />
7289
</div>
73-
<SharedContractLayout
74-
contractAddress={params.contractAddress}
75-
chainIdOrSlug={params.chainIdOrSlug}
76-
authToken={authToken}
77-
projectMeta={{
78-
teamId: team.id,
79-
projectSlug: params.project_slug,
80-
teamSlug: params.team_slug,
81-
}}
82-
>
83-
{props.children}
84-
</SharedContractLayout>
85-
<SaveLastUsedProject projectId={project.id} teamId={team.id} />
86-
<AppFooter />
87-
</div>
90+
</ErrorProvider>
8891
);
8992
}

0 commit comments

Comments
 (0)