From 0af6e0e94f5640ced1babaaa8cde0bb8d8e0857e Mon Sep 17 00:00:00 2001 From: franco sanchez Date: Thu, 12 Sep 2024 12:33:20 -0300 Subject: [PATCH] a small problem was corrected and a new Skeleton was added --- src/components/forms/NewBook.tsx | 42 ++++++++++---- src/components/skeletons/SkeletonABooks.tsx | 10 +--- src/components/skeletons/SkeletonProfile.tsx | 58 +++++++++++++++++++ src/hooks/RouteWatcher.ts | 19 +++++++ src/hooks/queries.ts | 2 +- src/hooks/useScrollYRestoration.ts | 2 +- src/pages/Favorites.tsx | 60 ++++++++++---------- src/pages/profile/Profile.tsx | 5 +- src/routes.tsx | 2 + 9 files changed, 147 insertions(+), 53 deletions(-) create mode 100644 src/components/skeletons/SkeletonProfile.tsx create mode 100644 src/hooks/RouteWatcher.ts diff --git a/src/components/forms/NewBook.tsx b/src/components/forms/NewBook.tsx index 6c29b10..9fbf674 100644 --- a/src/components/forms/NewBook.tsx +++ b/src/components/forms/NewBook.tsx @@ -113,12 +113,12 @@ export function FormNewBook() { handleImage(e, setCropData, onOpen); } - function handleRatingChange(newRating: number) { - setBooks((books) => ({ - ...books, - rating: newRating, - })); - } + // function handleRatingChange(newRating: number) { + // setBooks((books) => ({ + // ...books, + // rating: newRating, + // })); + // } function getCropData() { getCrop(crop, setPreviewImg, books, setBooks, onClose); @@ -551,7 +551,7 @@ export function FormNewBook() { placeholder='Elija un Formato' /> - + Calificación{' '} @@ -560,11 +560,31 @@ export function FormNewBook() { - + handleFieldChange('rating', selectedOption?.value) + } + options={[ + { value: 0, label: 0 }, + { value: 1, label: 1 }, + { value: 1.5, label: 1.5 }, + { value: 2, label: 2 }, + { value: 2.5, label: 2.5 }, + { value: 3, label: 3 }, + { value: 3.5, label: 3.5 }, + { value: 4, label: 4 }, + { value: 4.5, label: 4.5 }, + { value: 5, label: 5 }, + ]} + placeholder='Elija una Calificación' /> + + +