Skip to content

Commit bc72883

Browse files
committed
Migrate Network Config Modal from chakra to shadcn/tailwind (#4745)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR removes unused components, updates UI elements, and refactors form fields in the dashboard application. ### Detailed summary - Deleted `TooltipBox.tsx` and `ConfirmationPopover.tsx` - Updated UI elements in `IconUpload.tsx` and `ConfigureNetworkModal.tsx` - Refactored form fields in `ChainIdInput.tsx`, `RpcInput.tsx`, and `NetworkIDInput.tsx` > The following files were skipped due to too many changes: `apps/dashboard/src/@/components/ui/radio-group.tsx`, `apps/dashboard/src/components/configure-networks/ConfigureNetworkForm.tsx` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 0a4e445 commit bc72883

File tree

14 files changed

+292
-350
lines changed

14 files changed

+292
-350
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Label } from "@/components/ui/label";
2+
import { ToolTipLabel } from "@/components/ui/tooltip";
3+
import { AsteriskIcon, InfoIcon } from "lucide-react";
4+
5+
export function FormFieldSetup(props: {
6+
htmlFor: string;
7+
label: string;
8+
errorMessage: React.ReactNode | undefined;
9+
children: React.ReactNode;
10+
tooltip: React.ReactNode | undefined;
11+
isRequired: boolean;
12+
}) {
13+
return (
14+
<div>
15+
<div className="mb-2 inline-flex gap-1 items-center">
16+
<Label htmlFor={props.htmlFor}>{props.label}</Label>
17+
18+
{props.isRequired && (
19+
<AsteriskIcon className="text-destructive-text size-3.5" />
20+
)}
21+
22+
{props.tooltip && (
23+
<ToolTipLabel label={props.tooltip}>
24+
<InfoIcon className="text-muted-foreground size-3.5" />
25+
</ToolTipLabel>
26+
)}
27+
</div>
28+
{props.children}
29+
{props.errorMessage && (
30+
<p className="text-destructive-text text-sm mt-1">
31+
{props.errorMessage}
32+
</p>
33+
)}
34+
</div>
35+
);
36+
}

apps/dashboard/src/@/components/ui/radio-group.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const RadioGroupItem = React.forwardRef<
2929
<RadioGroupPrimitive.Item
3030
ref={ref}
3131
className={cn(
32-
"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
32+
"aspect-square h-4 w-4 rounded-full border border-inverted text-inverted ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
3333
className,
3434
)}
3535
{...props}
@@ -51,12 +51,12 @@ const RadioGroupItemButton = React.forwardRef<
5151
<RadioGroupPrimitive.Item
5252
ref={ref}
5353
className={cn(
54-
"cursor-pointer group flex items-center px-3 peer-hover:border-nonce py-4 space-x-3 space-y-0 border-2 rounded-md min-w-32 font-medium hover:border-foreground/25 transition-all data-[state=checked]:border-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
54+
"cursor-pointer group flex items-center px-3 peer-hover:border-nonce py-4 space-x-3 space-y-0 border-2 rounded-md min-w-32 font-medium hover:border-foreground/25 transition-all data-[state=checked]:border-inverted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
5555
className,
5656
)}
5757
{...props}
5858
>
59-
<div className="flex items-center justify-center w-4 h-4 border-2 rounded-full transition-all group-data-[state=checked]:border-primary text-primary group-hover:border-foreground/25 aspect-square ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50">
59+
<div className="flex items-center justify-center w-4 h-4 border-2 rounded-full transition-all group-data-[state=checked]:border-inverted text-inverted group-hover:border-foreground/25 aspect-square ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50">
6060
{/* Show on checked */}
6161
<RadioGroupPrimitive.Indicator className="flex items-center justify-center transition-all rounded-full">
6262
<Circle className="w-2 h-2 text-current fill-current" />

apps/dashboard/src/@/constants/thirdweb.client.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import {} from "@/constants/env";
21
import { useQuery } from "@tanstack/react-query";
32
import { useMemo } from "react";
43
import { useActiveAccount } from "thirdweb/react";

0 commit comments

Comments
 (0)