Skip to content

Commit

Permalink
chore: image upload limited from 5 MB to 1 MB
Browse files Browse the repository at this point in the history
  • Loading branch information
Franqsanz committed Nov 9, 2023
1 parent d223fa5 commit 84b3ca9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/forms/NewBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ export function FormNewBook() {
const file = e.target.files?.[0];
if (!file) return;

if (file.size > 5000000) {
// 5 MB
// 1 MB
if (file.size > 1000000) {
alert(
`El tamaño de la imagen es demasiado grande. Por favor, seleccione una imagen de menor tamaño.`,
);

return;
}

Expand Down Expand Up @@ -217,7 +218,7 @@ export function FormNewBook() {
</Box>
<Box mt='1' fontSize='13px'>
<Box as='span'>
Solo se aceptan formatos PNG, JPG y WebP con un máximo de 5 MB.
Solo se aceptan formatos PNG, JPG y WebP con un máximo de 1 MB.
</Box>
</Box>
</Box>
Expand Down
3 changes: 3 additions & 0 deletions src/data/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const categories: Array<SelectBooksType> = [
{ value: 'Botánica', label: 'Botánica' },
{ value: 'Biografía', label: 'Biografía' },
{ value: 'Ciencia Ficción', label: 'Ciencia Ficción' },
{ value: 'Crimen', label: 'Crimen' },
{ value: 'Contemporáneo', label: 'Contemporáneo' },
{ value: 'Clásicos', label: 'Clásicos' },
{ value: 'Cuidado Del Bebé', label: 'Cuidado Del Bebé' },
{ value: 'Comedia', label: 'Comedia' },
Expand Down Expand Up @@ -157,6 +159,7 @@ const categories: Array<SelectBooksType> = [
{ value: 'Humor Grafico', label: 'Humor Grafico' },
{ value: 'Thriller', label: 'Thriller' },
{ value: 'Thriller de Detectives', label: 'Thriller de Detectives' },
{ value: 'Thriller de Espías', label: 'Thriller de Espías' },
];

const format: Array<SelectBooksType> = [
Expand Down

1 comment on commit 84b3ca9

@vercel
Copy link

@vercel vercel bot commented on 84b3ca9 Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

xbu – ./

xbu-franqsanz.vercel.app
xbu-git-main-franqsanz.vercel.app
xbu.vercel.app

Please sign in to comment.