diff options
Diffstat (limited to 'packages/web')
| -rw-r--r-- | packages/web/app/dashboard/bookmarks/components/LinkCard.tsx | 6 | ||||
| -rw-r--r-- | packages/web/app/dashboard/components/Sidebar.tsx | 2 | ||||
| -rwxr-xr-x | packages/web/bun.lockb | bin | 158558 -> 0 bytes | |||
| -rw-r--r-- | packages/web/components/ui/form.tsx | 101 | ||||
| -rw-r--r-- | packages/web/components/ui/label.tsx | 20 |
5 files changed, 67 insertions, 62 deletions
diff --git a/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx b/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx index da59d9da..b5a051e8 100644 --- a/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx +++ b/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx @@ -76,7 +76,11 @@ export default function LinkCard({ link }: { link: ZBookmarkedLink }) { </ImageCardTitle> <ImageCardBody className="py-2 overflow-clip"> {link.tags.map((t) => ( - <Badge variant="default" className="bg-gray-300 text-gray-500" key={t.id}> + <Badge + variant="default" + className="bg-gray-300 text-gray-500" + key={t.id} + > #{t.name} </Badge> ))} diff --git a/packages/web/app/dashboard/components/Sidebar.tsx b/packages/web/app/dashboard/components/Sidebar.tsx index 0ed87daf..f2ead71a 100644 --- a/packages/web/app/dashboard/components/Sidebar.tsx +++ b/packages/web/app/dashboard/components/Sidebar.tsx @@ -1,6 +1,6 @@ import { Button } from "@/components/ui/button"; import { authOptions } from "@/lib/auth"; -import { Archive, MoreHorizontal, Star, Tag, Home, Brain} from "lucide-react"; +import { Archive, MoreHorizontal, Star, Tag, Home, Brain } from "lucide-react"; import { getServerSession } from "next-auth"; import Link from "next/link"; import { redirect } from "next/navigation"; diff --git a/packages/web/bun.lockb b/packages/web/bun.lockb Binary files differdeleted file mode 100755 index 7925e942..00000000 --- a/packages/web/bun.lockb +++ /dev/null diff --git a/packages/web/components/ui/form.tsx b/packages/web/components/ui/form.tsx index 4603f8b3..497718a9 100644 --- a/packages/web/components/ui/form.tsx +++ b/packages/web/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,27 @@ import { FieldValues, FormProvider, useFormContext, -} from "react-hook-form" +} from "react-hook-form"; -import { cn } from "@/lib/utils" -import { Label } from "@/components/ui/label" +import { cn } from "@/lib/utils"; +import { Label } from "@/components/ui/label"; -const Form = FormProvider +const Form = FormProvider; type FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues> + TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, > = { - name: TName -} + name: TName; +}; const FormFieldContext = React.createContext<FormFieldContextValue>( - {} as FormFieldContextValue -) + {} as FormFieldContextValue, +); const FormField = < TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues> + TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, >({ ...props }: ControllerProps<TFieldValues, TName>) => { @@ -36,21 +36,21 @@ const FormField = < <FormFieldContext.Provider value={{ name: props.name }}> <Controller {...props} /> </FormFieldContext.Provider> - ) -} + ); +}; const useFormField = () => { - const fieldContext = React.useContext(FormFieldContext) - const itemContext = React.useContext(FormItemContext) - const { getFieldState, formState } = useFormContext() + const fieldContext = React.useContext(FormFieldContext); + const itemContext = React.useContext(FormItemContext); + const { getFieldState, formState } = useFormContext(); - const fieldState = getFieldState(fieldContext.name, formState) + const fieldState = getFieldState(fieldContext.name, formState); if (!fieldContext) { - throw new Error("useFormField should be used within <FormField>") + throw new Error("useFormField should be used within <FormField>"); } - const { id } = itemContext + const { id } = itemContext; return { id, @@ -59,36 +59,36 @@ const useFormField = () => { formDescriptionId: `${id}-form-item-description`, formMessageId: `${id}-form-item-message`, ...fieldState, - } -} + }; +}; type FormItemContextValue = { - id: string -} + id: string; +}; const FormItemContext = React.createContext<FormItemContextValue>( - {} as FormItemContextValue -) + {} as FormItemContextValue, +); const FormItem = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement> >(({ className, ...props }, ref) => { - const id = React.useId() + const id = React.useId(); return ( <FormItemContext.Provider value={{ id }}> <div ref={ref} className={cn("space-y-2", className)} {...props} /> </FormItemContext.Provider> - ) -}) -FormItem.displayName = "FormItem" + ); +}); +FormItem.displayName = "FormItem"; const FormLabel = React.forwardRef< React.ElementRef<typeof LabelPrimitive.Root>, React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> >(({ className, ...props }, ref) => { - const { error, formItemId } = useFormField() + const { error, formItemId } = useFormField(); return ( <Label @@ -97,15 +97,16 @@ const FormLabel = React.forwardRef< htmlFor={formItemId} {...props} /> - ) -}) -FormLabel.displayName = "FormLabel" + ); +}); +FormLabel.displayName = "FormLabel"; const FormControl = React.forwardRef< React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot> >(({ ...props }, ref) => { - const { error, formItemId, formDescriptionId, formMessageId } = useFormField() + const { error, formItemId, formDescriptionId, formMessageId } = + useFormField(); return ( <Slot @@ -119,15 +120,15 @@ const FormControl = React.forwardRef< aria-invalid={!!error} {...props} /> - ) -}) -FormControl.displayName = "FormControl" + ); +}); +FormControl.displayName = "FormControl"; const FormDescription = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement> >(({ className, ...props }, ref) => { - const { formDescriptionId } = useFormField() + const { formDescriptionId } = useFormField(); return ( <p @@ -136,19 +137,19 @@ const FormDescription = React.forwardRef< className={cn("text-sm text-muted-foreground", className)} {...props} /> - ) -}) -FormDescription.displayName = "FormDescription" + ); +}); +FormDescription.displayName = "FormDescription"; const FormMessage = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement> >(({ className, children, ...props }, ref) => { - const { error, formMessageId } = useFormField() - const body = error ? String(error?.message) : children + const { error, formMessageId } = useFormField(); + const body = error ? String(error?.message) : children; if (!body) { - return null + return null; } return ( @@ -160,9 +161,9 @@ const FormMessage = React.forwardRef< > {body} </p> - ) -}) -FormMessage.displayName = "FormMessage" + ); +}); +FormMessage.displayName = "FormMessage"; export { useFormField, @@ -173,4 +174,4 @@ export { FormDescription, FormMessage, FormField, -} +}; diff --git a/packages/web/components/ui/label.tsx b/packages/web/components/ui/label.tsx index 53418217..84f8b0c7 100644 --- a/packages/web/components/ui/label.tsx +++ b/packages/web/components/ui/label.tsx @@ -1,14 +1,14 @@ -"use client" +"use client"; -import * as React from "react" -import * as LabelPrimitive from "@radix-ui/react-label" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import * as LabelPrimitive from "@radix-ui/react-label"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const labelVariants = cva( - "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" -) + "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", +); const Label = React.forwardRef< React.ElementRef<typeof LabelPrimitive.Root>, @@ -20,7 +20,7 @@ const Label = React.forwardRef< className={cn(labelVariants(), className)} {...props} /> -)) -Label.displayName = LabelPrimitive.Root.displayName +)); +Label.displayName = LabelPrimitive.Root.displayName; -export { Label } +export { Label }; |
