Skip to content

Commit 0361704

Browse files
committed
Dashboard: Migrate contract/permissions page from chakra to tailwind, UI improvements (#7750)
<!-- ## 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 enhancing the `Permissions` component and related files by improving UI elements, restructuring code for clarity, and integrating better user feedback mechanisms such as alerts and toast notifications. ### Detailed summary - Updated the `Permissions` component's return structure to include headings and descriptions. - Refined the `alertVariants` in `alert.tsx` for better styling. - Replaced `ButtonGroup` with a `div` for layout adjustments in the `Permissions` component. - Enhanced error handling with toast notifications in `permissions-editor.tsx`. - Improved form handling and cleaned up values before submission. - Replaced `DelayedDisplay` with an `Alert` component in `permissions-editor.tsx`. - Updated the `ContractPermission` component to utilize `Select` for role management instead of traditional dropdowns. - Added conditional rendering for alerts based on role states in `ContractPermission`. - Adjusted button styles and behavior for better user experience across components. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 04c7243 commit 0361704

File tree

6 files changed

+320
-486
lines changed

6 files changed

+320
-486
lines changed

apps/dashboard/src/@/components/misc/delayed-display.tsx

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as React from "react";
44
import { cn } from "@/lib/utils";
55

66
const alertVariants = cva(
7-
"bg-card relative w-full rounded-lg border border-border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
7+
"bg-card relative w-full rounded-xl border border-border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
88
{
99
defaultVariants: {
1010
variant: "default",
@@ -38,7 +38,7 @@ const AlertTitle = React.forwardRef<
3838
React.HTMLAttributes<HTMLHeadingElement>
3939
>(({ className, ...props }, ref) => (
4040
<h5
41-
className={cn("font-medium leading-tight tracking-tight", className)}
41+
className={cn("font-medium leading-tight", className)}
4242
ref={ref}
4343
{...props}
4444
/>
@@ -51,7 +51,7 @@ const AlertDescription = React.forwardRef<
5151
>(({ className, ...props }, ref) => (
5252
<div
5353
className={cn(
54-
"mt-1.5 text-muted-foreground text-sm [&_p]:leading-relaxed",
54+
"mt-1 text-muted-foreground text-sm [&_p]:leading-relaxed",
5555
className,
5656
)}
5757
ref={ref}

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/permissions/ContractPermissionsPage.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,15 @@ export function ContractPermissionsPage({
5656
);
5757
}
5858

59-
return <Permissions contract={contract} isLoggedIn={isLoggedIn} />;
59+
return (
60+
<div>
61+
<h2 className="text-2xl font-semibold tracking-tight mb-0.5">
62+
Permissions
63+
</h2>
64+
<p className="text-muted-foreground mb-6">
65+
View and manage the permissions for this contract
66+
</p>
67+
<Permissions contract={contract} isLoggedIn={isLoggedIn} />
68+
</div>
69+
);
6070
}

0 commit comments

Comments
 (0)