Last active
November 16, 2024 20:40
-
-
Save codigoconjuan/fb8b0f19114b6ed1bceb391ff7f28f7d to your computer and use it in GitHub Desktop.
Subir Imágenes react-dropzone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div className="space-y-1"> | |
<label className="block text-sm font-medium leading-6 text-gray-900"> | |
Imagen Producto | |
</label> | |
<div {...getRootProps({ | |
className: ` | |
py-20 border-2 border-dashed text-center | |
${isDragActive ? 'border-gray-900 text-gray-900 bg-gray-200 ' : 'border-gray-400 text-gray-400 bg-white'} | |
${isDragReject ? 'border-none bg-white' : 'cursor-not-allowed'} | |
`})}> | |
<input {...getInputProps()} /> | |
{isDragAccept && (<p>Suelta la Imagen</p>)} | |
{isDragReject && (<p>Archivo no válido</p>)} | |
{!isDragActive && (<p>Arrastra y suelta una imagen aquí</p>)} | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment