Skip to content

Commit

Permalink
fix: allow customing class name
Browse files Browse the repository at this point in the history
  • Loading branch information
aramalipoor committed Mar 26, 2022
1 parent dd4274c commit 7994cfc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { useDropzone } from "react-dropzone";

export type ImageFieldProps = {
label: string;
className?: string;
setImageFile: React.Dispatch<React.SetStateAction<File | undefined>>;
setImagePreview?: React.Dispatch<React.SetStateAction<string | undefined>>;
};

export const ImageField = (props: ImageFieldProps) => {
const {
label,
className,
setImageFile: parentSetImageFile,
setImagePreview: parentSetImagePreview,
} = props;
Expand All @@ -34,7 +36,7 @@ export const ImageField = (props: ImageFieldProps) => {
const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop });

return (
<div {...getRootProps()}>
<div {...getRootProps()} className={className}>
<label className="block text-sm font-medium text-gray-700">{label}</label>
<div
className={`mt-1 px-6 pt-5 pb-6 border-2 border-dashed rounded-md focus-within:ring-1 focus-within:ring-indigo-600 focus-within:border-indigo-600 ${
Expand Down

0 comments on commit 7994cfc

Please sign in to comment.