From d786bcd6d873e040a4ed6c4c18f41435435219a9 Mon Sep 17 00:00:00 2001 From: Doug Richar Date: Thu, 4 Apr 2024 03:25:48 -0400 Subject: [PATCH] chore(ui): run prettier/eslint --- ui/.prettierignore | 7 +- ui/src/api/contracts.ts | 1 - ui/src/components/ui/avatar.tsx | 17 ++--- ui/src/components/ui/card.tsx | 116 +++++++++++++------------------ ui/src/components/ui/form.tsx | 69 ++++++++---------- ui/src/components/ui/label.tsx | 19 ++--- ui/src/components/ui/sonner.tsx | 18 +++-- ui/src/components/ui/tooltip.tsx | 10 +-- ui/src/main.tsx | 12 +++- ui/src/styles/main.css | 4 +- 10 files changed, 120 insertions(+), 153 deletions(-) diff --git a/ui/.prettierignore b/ui/.prettierignore index dbda6ae9..3ab7444f 100644 --- a/ui/.prettierignore +++ b/ui/.prettierignore @@ -1,12 +1,9 @@ -# don't ever format node_modules node_modules -# don't lint format output (make sure it's set to your correct build folder name) dist build -# don't format nyc coverage output coverage -# don't format generated types **/generated/types.d.ts **/generated/types.ts -# don't format ide files .idea + +src/contracts diff --git a/ui/src/api/contracts.ts b/ui/src/api/contracts.ts index f6ee97df..4e4ef12d 100644 --- a/ui/src/api/contracts.ts +++ b/ui/src/api/contracts.ts @@ -26,7 +26,6 @@ import { } from '@/utils/contracts' import { getAlgodConfigFromViteEnvironment } from '@/utils/network/getAlgoClientConfigs' import { getRetiAppIdFromViteEnvironment } from '@/utils/env' -import { getActiveWalletAddress } from '@/utils/wallets' const algodConfig = getAlgodConfigFromViteEnvironment() const algodClient = algokit.getAlgoClient({ diff --git a/ui/src/components/ui/avatar.tsx b/ui/src/components/ui/avatar.tsx index 33ae3c6e..26e303f1 100644 --- a/ui/src/components/ui/avatar.tsx +++ b/ui/src/components/ui/avatar.tsx @@ -1,7 +1,7 @@ -import * as React from "react" -import * as AvatarPrimitive from "@radix-ui/react-avatar" +import * as React from 'react' +import * as AvatarPrimitive from '@radix-ui/react-avatar' -import { cn } from "@/utils/ui" +import { cn } from '@/utils/ui' const Avatar = React.forwardRef< React.ElementRef, @@ -9,10 +9,7 @@ const Avatar = React.forwardRef< >(({ className, ...props }, ref) => ( )) @@ -24,7 +21,7 @@ const AvatarImage = React.forwardRef< >(({ className, ...props }, ref) => ( )) @@ -37,8 +34,8 @@ const AvatarFallback = React.forwardRef< diff --git a/ui/src/components/ui/card.tsx b/ui/src/components/ui/card.tsx index d67b9e57..d009c087 100644 --- a/ui/src/components/ui/card.tsx +++ b/ui/src/components/ui/card.tsx @@ -1,76 +1,56 @@ -import * as React from "react" - -import { cn } from "@/utils/ui" - -const Card = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -Card.displayName = "Card" - -const CardHeader = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -CardHeader.displayName = "CardHeader" - -const CardTitle = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)) -CardTitle.displayName = "CardTitle" +import * as React from 'react' + +import { cn } from '@/utils/ui' + +const Card = React.forwardRef>( + ({ className, ...props }, ref) => ( +
+ ), +) +Card.displayName = 'Card' + +const CardHeader = React.forwardRef>( + ({ className, ...props }, ref) => ( +
+ ), +) +CardHeader.displayName = 'CardHeader' + +const CardTitle = React.forwardRef>( + ({ className, ...props }, ref) => ( +

+ ), +) +CardTitle.displayName = 'CardTitle' const CardDescription = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes >(({ className, ...props }, ref) => ( -

-)) -CardDescription.displayName = "CardDescription" - -const CardContent = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)) -CardContent.displayName = "CardContent" - -const CardFooter = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
+

)) -CardFooter.displayName = "CardFooter" +CardDescription.displayName = 'CardDescription' + +const CardContent = React.forwardRef>( + ({ className, ...props }, ref) => ( +

+ ), +) +CardContent.displayName = 'CardContent' + +const CardFooter = React.forwardRef>( + ({ className, ...props }, ref) => ( +
+ ), +) +CardFooter.displayName = 'CardFooter' export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } diff --git a/ui/src/components/ui/form.tsx b/ui/src/components/ui/form.tsx index 76125903..cbe3c7aa 100644 --- a/ui/src/components/ui/form.tsx +++ b/ui/src/components/ui/form.tsx @@ -1,6 +1,6 @@ -import * as React from "react" -import * as LabelPrimitive from "@radix-ui/react-label" -import { Slot } from "@radix-ui/react-slot" +import * as React from 'react' +import * as LabelPrimitive from '@radix-ui/react-label' +import { Slot } from '@radix-ui/react-slot' import { Controller, ControllerProps, @@ -8,27 +8,25 @@ import { FieldValues, FormProvider, useFormContext, -} from "react-hook-form" +} from 'react-hook-form' -import { cn } from "@/utils/ui" -import { Label } from "@/components/ui/label" +import { cn } from '@/utils/ui' +import { Label } from '@/components/ui/label' const Form = FormProvider type FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath + TName extends FieldPath = FieldPath, > = { name: TName } -const FormFieldContext = React.createContext( - {} as FormFieldContextValue -) +const FormFieldContext = React.createContext({} as FormFieldContextValue) const FormField = < TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath + TName extends FieldPath = FieldPath, >({ ...props }: ControllerProps) => { @@ -47,7 +45,7 @@ const useFormField = () => { const fieldState = getFieldState(fieldContext.name, formState) if (!fieldContext) { - throw new Error("useFormField should be used within ") + throw new Error('useFormField should be used within ') } const { id } = itemContext @@ -66,23 +64,20 @@ type FormItemContextValue = { id: string } -const FormItemContext = React.createContext( - {} as FormItemContextValue -) +const FormItemContext = React.createContext({} as FormItemContextValue) -const FormItem = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => { - const id = React.useId() +const FormItem = React.forwardRef>( + ({ className, ...props }, ref) => { + const id = React.useId() - return ( - -
- - ) -}) -FormItem.displayName = "FormItem" + return ( + +
+ + ) + }, +) +FormItem.displayName = 'FormItem' const FormLabel = React.forwardRef< React.ElementRef, @@ -93,13 +88,13 @@ const FormLabel = React.forwardRef< return (