diff --git a/packages/explorer/src/components/account-select.tsx b/packages/explorer/src/components/account-select.tsx deleted file mode 100644 index 67aa0fb342..0000000000 --- a/packages/explorer/src/components/account-select.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { formatEther } from "viem"; -import { useEffect } from "react"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; -import { ACCOUNTS } from "@/consts"; -import { useStore } from "@/store"; - -export function AccountSelect() { - const { account, setAccount, balances, fetchBalances } = useStore(); - - useEffect(() => { - fetchBalances(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - return ( - - ); -} diff --git a/packages/explorer/src/components/account.tsx b/packages/explorer/src/components/account.tsx deleted file mode 100644 index 286e8baf90..0000000000 --- a/packages/explorer/src/components/account.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { useAccount, useDisconnect, useEnsAvatar, useEnsName } from "wagmi"; - -export function Account() { - const { address } = useAccount(); - const { disconnect } = useDisconnect(); - const { data: ensName } = useEnsName({ address }); - const { data: ensAvatar } = useEnsAvatar({ name: ensName! }); - - return ( -
- {ensAvatar && ENS Avatar} - {address &&
{ensName ? `${ensName} (${address})` : address}
} - -
- ); -} diff --git a/packages/explorer/src/components/connect-wallet.tsx b/packages/explorer/src/components/connect-wallet.tsx deleted file mode 100644 index dd497be4b8..0000000000 --- a/packages/explorer/src/components/connect-wallet.tsx +++ /dev/null @@ -1,11 +0,0 @@ -"use client"; - -import { useAccount } from "wagmi"; -import { Account } from "@/components/account"; -import { WalletOptions } from "@/components/wallet-options"; - -export function ConnectWallet() { - const { isConnected } = useAccount(); - if (isConnected) return ; - return ; -} diff --git a/packages/explorer/src/components/latest-block.tsx b/packages/explorer/src/components/latest-block.tsx deleted file mode 100644 index a7520ee485..0000000000 --- a/packages/explorer/src/components/latest-block.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { useBlockNumber } from "wagmi"; - -export function LatestBlock() { - const { data: block } = useBlockNumber({ - watch: true, - }); - - if (block === undefined || block === BigInt(0)) { - return; - } - - return ( -
-
- - {block.toString()} -
-
- ); -} diff --git a/packages/explorer/src/components/navigation.tsx b/packages/explorer/src/components/navigation.tsx deleted file mode 100644 index d1dc846cec..0000000000 --- a/packages/explorer/src/components/navigation.tsx +++ /dev/null @@ -1,47 +0,0 @@ -"use client"; - -import Link from "next/link"; -import { usePathname } from "next/navigation"; -import { LatestBlock } from "@/components/latest-block"; -import { cn } from "@/lib/utils"; -import { AccountSelect } from "./account-select"; -import { Separator } from "./ui/separator"; - -export function Navigation() { - const pathname = usePathname(); - - return ( -
-
-
- - Data explorer - - - - Interact - -
- -
- - -
-
- - -
- ); -} diff --git a/packages/explorer/src/components/ui/button.tsx b/packages/explorer/src/components/ui/button.tsx deleted file mode 100644 index 52b598fdec..0000000000 --- a/packages/explorer/src/components/ui/button.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { type VariantProps, cva } from "class-variance-authority"; -import * as React from "react"; -import { Slot } from "@radix-ui/react-slot"; -import { cn } from "@/lib/utils"; - -const buttonVariants = cva( - // eslint-disable-next-line max-len - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", - { - variants: { - variant: { - default: "bg-primary text-primary-foreground hover:bg-primary/90", - destructive: - "bg-destructive text-destructive-foreground hover:bg-destructive/90", - outline: - "border border-input bg-background hover:bg-accent hover:text-accent-foreground", - secondary: - "bg-secondary text-secondary-foreground hover:bg-secondary/80", - ghost: "hover:bg-accent hover:text-accent-foreground", - link: "text-primary underline-offset-4 hover:underline", - }, - size: { - default: "h-10 px-4 py-2", - sm: "h-9 rounded-md px-3", - lg: "h-11 rounded-md px-8", - icon: "h-10 w-10", - }, - }, - defaultVariants: { - variant: "default", - size: "default", - }, - }, -); - -export interface ButtonProps - extends React.ButtonHTMLAttributes, - VariantProps { - asChild?: boolean; -} - -const Button = React.forwardRef( - ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : "button"; - return ( - - ); - }, -); -Button.displayName = "Button"; - -export { Button, buttonVariants }; diff --git a/packages/explorer/src/components/ui/checkbox.tsx b/packages/explorer/src/components/ui/checkbox.tsx deleted file mode 100644 index 592d5d2aa3..0000000000 --- a/packages/explorer/src/components/ui/checkbox.tsx +++ /dev/null @@ -1,30 +0,0 @@ -"use client"; - -import { Check } from "lucide-react"; -import * as React from "react"; -import * as CheckboxPrimitive from "@radix-ui/react-checkbox"; -import { cn } from "@/lib/utils"; - -const Checkbox = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - - - -)); -Checkbox.displayName = CheckboxPrimitive.Root.displayName; - -export { Checkbox }; diff --git a/packages/explorer/src/components/ui/dropdown-menu.tsx b/packages/explorer/src/components/ui/dropdown-menu.tsx deleted file mode 100644 index f36bd7f8dd..0000000000 --- a/packages/explorer/src/components/ui/dropdown-menu.tsx +++ /dev/null @@ -1,204 +0,0 @@ -"use client"; - -import { Check, ChevronRight, Circle } from "lucide-react"; -import * as React from "react"; -import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"; -import { cn } from "@/lib/utils"; - -const DropdownMenu = DropdownMenuPrimitive.Root; - -const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger; - -const DropdownMenuGroup = DropdownMenuPrimitive.Group; - -const DropdownMenuPortal = DropdownMenuPrimitive.Portal; - -const DropdownMenuSub = DropdownMenuPrimitive.Sub; - -const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup; - -const DropdownMenuSubTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean; - } ->(({ className, inset, children, ...props }, ref) => ( - - {children} - - -)); -DropdownMenuSubTrigger.displayName = - DropdownMenuPrimitive.SubTrigger.displayName; - -const DropdownMenuSubContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); -DropdownMenuSubContent.displayName = - DropdownMenuPrimitive.SubContent.displayName; - -const DropdownMenuContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, sideOffset = 4, ...props }, ref) => ( - - - -)); -DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName; - -const DropdownMenuItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean; - } ->(({ className, inset, ...props }, ref) => ( - -)); -DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName; - -const DropdownMenuCheckboxItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, checked, ...props }, ref) => ( - - - - - - - {children} - -)); -DropdownMenuCheckboxItem.displayName = - DropdownMenuPrimitive.CheckboxItem.displayName; - -const DropdownMenuRadioItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( - - - - - - - {children} - -)); -DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName; - -const DropdownMenuLabel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean; - } ->(({ className, inset, ...props }, ref) => ( - -)); -DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName; - -const DropdownMenuSeparator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); -DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName; - -const DropdownMenuShortcut = ({ - className, - ...props -}: React.HTMLAttributes) => { - return ( - - ); -}; -DropdownMenuShortcut.displayName = "DropdownMenuShortcut"; - -export { - DropdownMenu, - DropdownMenuTrigger, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuCheckboxItem, - DropdownMenuRadioItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuShortcut, - DropdownMenuGroup, - DropdownMenuPortal, - DropdownMenuSub, - DropdownMenuSubContent, - DropdownMenuSubTrigger, - DropdownMenuRadioGroup, -}; diff --git a/packages/explorer/src/components/ui/form.tsx b/packages/explorer/src/components/ui/form.tsx deleted file mode 100644 index df4699cfa0..0000000000 --- a/packages/explorer/src/components/ui/form.tsx +++ /dev/null @@ -1,178 +0,0 @@ -"use client"; - -import * as React from "react"; -import { - Controller, - ControllerProps, - FieldPath, - FieldValues, - FormProvider, - useFormContext, -} from "react-hook-form"; -import * as LabelPrimitive from "@radix-ui/react-label"; -import { Slot } from "@radix-ui/react-slot"; -import { Label } from "@/components/ui/label"; -import { cn } from "@/lib/utils"; - -const Form = FormProvider; - -type FormFieldContextValue< - TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath, -> = { - name: TName; -}; - -const FormFieldContext = React.createContext( - {} as FormFieldContextValue, -); - -const FormField = < - TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath, ->({ - ...props -}: ControllerProps) => { - return ( - - - - ); -}; - -const useFormField = () => { - const fieldContext = React.useContext(FormFieldContext); - const itemContext = React.useContext(FormItemContext); - const { getFieldState, formState } = useFormContext(); - - const fieldState = getFieldState(fieldContext.name, formState); - - if (!fieldContext) { - throw new Error("useFormField should be used within "); - } - - const { id } = itemContext; - - return { - id, - name: fieldContext.name, - formItemId: `${id}-form-item`, - formDescriptionId: `${id}-form-item-description`, - formMessageId: `${id}-form-item-message`, - ...fieldState, - }; -}; - -type FormItemContextValue = { - id: string; -}; - -const FormItemContext = React.createContext( - {} as FormItemContextValue, -); - -const FormItem = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => { - const id = React.useId(); - - return ( - -
- - ); -}); -FormItem.displayName = "FormItem"; - -const FormLabel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => { - const { error, formItemId } = useFormField(); - - return ( -