feat: replace custom Textarea component with UI library version across multiple files
This commit is contained in:
parent
319229830e
commit
b0c00e2d0f
9 changed files with 8 additions and 29 deletions
|
|
@ -27,7 +27,6 @@ import {
|
|||
CredenzaTitle,
|
||||
CredenzaTrigger,
|
||||
} from "../custom_ui/credenza";
|
||||
import { Textarea } from "../custom_ui/textarea";
|
||||
import { Button } from "../ui/button";
|
||||
import Input from "../ui/input";
|
||||
import { Label } from "../ui/label";
|
||||
|
|
@ -40,6 +39,7 @@ import {
|
|||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "../ui/select";
|
||||
import { Textarea } from "../ui/textarea";
|
||||
import { UserAvatar } from "../user_avatar";
|
||||
|
||||
export const Potenziali = () => {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import { useRouter } from "next/router";
|
|||
import { useEffect, useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import LoadingButton from "~/components/custom_ui/loading-button";
|
||||
import { Textarea } from "~/components/custom_ui/textarea";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
|
|
@ -26,6 +25,7 @@ import {
|
|||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "~/components/ui/dialog";
|
||||
import { Textarea } from "~/components/ui/textarea";
|
||||
import { useUserViewContext } from "~/lib/userViewContext";
|
||||
import { api } from "~/utils/api";
|
||||
import { Confirm } from "../confirm";
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
import { forwardRef, type TextareaHTMLAttributes } from "react";
|
||||
import { cn } from "src/lib/utils";
|
||||
|
||||
type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;
|
||||
|
||||
const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
({ className, ...props }, ref) => {
|
||||
return (
|
||||
<textarea
|
||||
className={cn(
|
||||
`flex min-h-20 w-full rounded-lg border border-border bg-background px-3 py-2 shadow-sm outline-hidden transition-all duration-200 hover:border-muted-foreground focus:border-foreground focus:ring-foreground disabled:cursor-not-allowed disabled:opacity-50 dark:border-input dark:bg-input/30 dark:hover:border-muted-foreground dark:hover:bg-input/50 dark:placeholder:text-neutral-400`,
|
||||
className,
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
},
|
||||
);
|
||||
Textarea.displayName = "Textarea";
|
||||
|
||||
export { Textarea };
|
||||
|
|
@ -9,6 +9,7 @@ import {
|
|||
UserActions,
|
||||
} from "~/components/servizio/annuncio_actions";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
|
||||
import { Textarea } from "~/components/ui/textarea";
|
||||
import { useMediaQuery } from "~/hooks/use-media-query";
|
||||
import { handleConsegna } from "~/lib/annuncio_details";
|
||||
import { getStorageUrl } from "~/lib/storage_utils";
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
|||
return (
|
||||
<textarea
|
||||
className={cn(
|
||||
"field-sizing-content flex min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs outline-hidden transition-[color,box-shadow] placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
||||
`flex min-h-20 w-full rounded-lg border border-border bg-background px-3 py-2 shadow-sm outline-hidden transition-all duration-200 hover:border-muted-foreground focus:border-foreground focus:ring-foreground disabled:cursor-not-allowed disabled:opacity-50 dark:border-input dark:bg-input/30 dark:hover:border-muted-foreground dark:hover:bg-input/50 dark:placeholder:text-neutral-400`,
|
||||
className,
|
||||
)}
|
||||
data-slot="textarea"
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ import {
|
|||
FormLabel,
|
||||
FormMessage,
|
||||
} from "~/components/custom_ui/form";
|
||||
import { Textarea } from "~/components/custom_ui/textarea";
|
||||
import { Checkbox } from "~/components/ui/checkbox";
|
||||
import Input from "~/components/ui/input";
|
||||
import { PhoneInput } from "~/components/ui/phone-input";
|
||||
import { Textarea } from "~/components/ui/textarea";
|
||||
import { useZodForm } from "~/lib/zodForm";
|
||||
import { useTranslation } from "~/providers/I18nProvider";
|
||||
import { api } from "~/utils/api";
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import {
|
|||
type ListOption,
|
||||
MultiSelect,
|
||||
} from "~/components/custom_ui/multiselect";
|
||||
import { Textarea } from "~/components/custom_ui/textarea";
|
||||
import { Button } from "~/components/ui/button";
|
||||
import { Calendar } from "~/components/ui/calendar";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
|
||||
|
|
@ -50,6 +49,7 @@ import {
|
|||
} from "~/components/ui/select";
|
||||
import { Switch } from "~/components/ui/switch";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/components/ui/tabs";
|
||||
import { Textarea } from "~/components/ui/textarea";
|
||||
import { VideoPlayer } from "~/components/videoPlayer";
|
||||
import { FieldResetButton } from "~/forms/comps";
|
||||
import { filteredCaratteristiche } from "~/hooks/schedaAnnuncioUtils";
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import {
|
|||
} from "~/components/custom_ui/form";
|
||||
import { NumberInput } from "~/components/custom_ui/InputNumber";
|
||||
import { MultiSelect, UnpackOptions } from "~/components/custom_ui/multiselect";
|
||||
import { Textarea } from "~/components/custom_ui/textarea";
|
||||
import { Button } from "~/components/ui/button";
|
||||
import Input from "~/components/ui/input";
|
||||
import {
|
||||
|
|
@ -20,6 +19,7 @@ import {
|
|||
SelectValue,
|
||||
} from "~/components/ui/select";
|
||||
import { Switch } from "~/components/ui/switch";
|
||||
import { Textarea } from "~/components/ui/textarea";
|
||||
import { FieldResetButton } from "~/forms/comps";
|
||||
import { useZodForm } from "~/lib/zodForm";
|
||||
import OrderTypeEnum from "~/schemas/public/OrderTypeEnum";
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ import {
|
|||
FormMessage,
|
||||
} from "~/components/custom_ui/form";
|
||||
import { DualInputLayout } from "~/components/custom_ui/inputLayouts";
|
||||
import { Textarea } from "~/components/custom_ui/textarea";
|
||||
import { Badge } from "~/components/ui/badge";
|
||||
import { Button } from "~/components/ui/button";
|
||||
import { Checkbox } from "~/components/ui/checkbox";
|
||||
import Input from "~/components/ui/input";
|
||||
import { PhoneInput } from "~/components/ui/phone-input";
|
||||
import { Textarea } from "~/components/ui/textarea";
|
||||
import { useZodForm } from "~/lib/zodForm";
|
||||
import { useTranslation } from "~/providers/I18nProvider";
|
||||
import { api } from "~/utils/api";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue