Skip to content

Commit

Permalink
refactor: "CustomTextarea" -> "Textarea"
Browse files Browse the repository at this point in the history
  • Loading branch information
galenwinsor committed Jul 15, 2024
1 parent 2da3417 commit 6f8ed9b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/components/DownloadModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Dialog from "@radix-ui/react-dialog"
import * as Form from "@radix-ui/react-form"
import { Cross2Icon, DownloadIcon, PlusIcon } from "@radix-ui/react-icons"
import { useForm, Controller, type SubmitHandler } from "react-hook-form"
import { CustomTextarea } from "./Textarea.tsx"
import { Textarea } from "./Textarea.tsx"
import Button from "./Button.tsx"
import { Input } from "./Input.tsx"

Expand Down Expand Up @@ -98,7 +98,7 @@ const DownloadModal: React.FC<DownloadModalProps> = ({ filesToDownload }) => {
name="description"
control={control}
render={() => (
<CustomTextarea
<Textarea
label="Description"
placeholder="Why you need this file..."
{...register("description")}
Expand Down
11 changes: 0 additions & 11 deletions src/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
errorMessage?: string
}

// input,
// select {
// @apply bg-white;
// @apply rounded-full;
// @apply shadow-inner;
// @apply min-w-60;
// @apply w-max;
// @apply py-3;
// @apply px-5;
// }

export const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ label, name, icon, match, errorMessage, ...delegated }: InputProps, ref) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
name: string
}

export const CustomTextarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
({ name, label, ...delegated }, ref) => (
<Form.Field name={name} className="flex flex-col gap-2">
<Form.Label>{label}</Form.Label>
Expand Down

0 comments on commit 6f8ed9b

Please sign in to comment.