Skip to content

Commit 882ed83

Browse files
committed
Dashboard: Migrate engine/relayers page from chakra to tailwind, remove chakra provider from engine layout (#7724)
<!-- ## 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 refactoring components related to relayers in a blockchain dashboard application, improving the user interface and functionality of forms, modals, and data handling for adding, editing, and removing relayers. ### Detailed summary - Removed `preventOpenOnFocus` prop from several components. - Updated `WalletAddress` component to streamline address handling. - Refactored `AddRelayerButton` and `EditModal` to use new dialog components. - Enhanced form validation using `zod` for relayer forms. - Improved UI with consistent styling and layout adjustments. - Updated `RelayersTable` to use new UI components and improved address display. - Added error handling and success notifications for relayer actions. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 0386638 commit 882ed83

File tree

8 files changed

+587
-416
lines changed

8 files changed

+587
-416
lines changed

apps/dashboard/src/@/components/blocks/wallet-address.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export function WalletAddress(props: {
2323
className?: string;
2424
iconClassName?: string;
2525
client: ThirdwebClient;
26-
preventOpenOnFocus?: boolean;
2726
}) {
2827
// default back to zero address if no address provided
2928
const address = useMemo(() => props.address || ZERO_ADDRESS, [props.address]);
@@ -68,10 +67,7 @@ export function WalletAddress(props: {
6867

6968
return (
7069
<HoverCard>
71-
<HoverCardTrigger
72-
asChild
73-
tabIndex={props.preventOpenOnFocus ? -1 : undefined}
74-
>
70+
<HoverCardTrigger asChild tabIndex={-1}>
7571
<Button
7672
className={cn(
7773
"flex flex-row items-center gap-2 px-0",

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/token-viewer/token-viewer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ function TokenInfoUI(props: {
269269
className="h-auto py-0 text-sm"
270270
client={props.contract.client}
271271
iconClassName="hidden"
272-
preventOpenOnFocus
273272
/>
274273
</div>
275274
) : (

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/dedicated/(instance)/[engineId]/layout.tsx

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ChakraProviderSetup } from "chakra/ChakraProviderSetup";
21
import { getAuthToken } from "@/api/auth-token";
32
import {
43
Breadcrumb,
@@ -59,32 +58,30 @@ export default async function Layout(props: {
5958
}
6059

6160
return (
62-
<ChakraProviderSetup>
63-
<div className="flex grow flex-col">
64-
<EngineInstanceHeader
65-
instance={instance}
66-
rootPath={engineRootLayoutPath}
67-
teamSlug={params.team_slug}
68-
/>
61+
<div className="flex grow flex-col">
62+
<EngineInstanceHeader
63+
instance={instance}
64+
rootPath={engineRootLayoutPath}
65+
teamSlug={params.team_slug}
66+
/>
6967

70-
<EngineSidebarLayout
68+
<EngineSidebarLayout
69+
engineId={params.engineId}
70+
projectSlug={params.project_slug}
71+
teamSlug={params.team_slug}
72+
>
73+
<EnsureEnginePermission
74+
accountId={account.id}
75+
authToken={authToken}
7176
engineId={params.engineId}
77+
instance={instance}
7278
projectSlug={params.project_slug}
7379
teamSlug={params.team_slug}
7480
>
75-
<EnsureEnginePermission
76-
accountId={account.id}
77-
authToken={authToken}
78-
engineId={params.engineId}
79-
instance={instance}
80-
projectSlug={params.project_slug}
81-
teamSlug={params.team_slug}
82-
>
83-
<div>{props.children}</div>
84-
</EnsureEnginePermission>
85-
</EngineSidebarLayout>
86-
</div>
87-
</ChakraProviderSetup>
81+
<div>{props.children}</div>
82+
</EnsureEnginePermission>
83+
</EngineSidebarLayout>
84+
</div>
8885
);
8986
}
9087

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/dedicated/(instance)/[engineId]/overview/components/backend-wallets-table.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ function EditModalContent({
404404
<WalletAddress
405405
address={backendWallet.address}
406406
client={client}
407-
preventOpenOnFocus
408407
iconClassName="size-4"
409408
className="h-auto py-0"
410409
/>
@@ -609,7 +608,6 @@ const SendFundsModal = ({
609608
address={fromWallet.address}
610609
client={client}
611610
iconClassName="size-4"
612-
preventOpenOnFocus
613611
className="h-auto py-0"
614612
/>
615613
</div>
@@ -802,7 +800,6 @@ function DeleteModal({
802800
<WalletAddress
803801
address={backendWallet.address}
804802
client={client}
805-
preventOpenOnFocus
806803
iconClassName="size-4"
807804
className="h-auto py-1"
808805
/>

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/dedicated/(instance)/[engineId]/overview/components/transaction-timeline.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ function CancelTransactionButton({
278278
shortenAddress={false}
279279
className="h-auto py-1"
280280
iconClassName="size-4"
281-
preventOpenOnFocus
282281
/>
283282
</div>
284283

0 commit comments

Comments
 (0)