diff --git a/src/components/aside/AboutCategories.tsx b/src/components/aside/AboutCategories.tsx
index a106aa4..3358f08 100644
--- a/src/components/aside/AboutCategories.tsx
+++ b/src/components/aside/AboutCategories.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import { Box, Text } from '@chakra-ui/react';
-import { aboutCategories } from '../../data/links';
+import { aboutCategories } from '../../constant/constants';
export function AboutCategories({ category }: any) {
const filteredAboutCategories = aboutCategories.filter((item) => {
diff --git a/src/components/forms/FormEdit.tsx b/src/components/forms/FormEdit.tsx
index 2bcdbc5..bd94bf5 100644
--- a/src/components/forms/FormEdit.tsx
+++ b/src/components/forms/FormEdit.tsx
@@ -23,7 +23,7 @@ import { BiImageAdd } from 'react-icons/bi';
import { FaCheckCircle } from 'react-icons/fa';
import { IoWarningSharp } from 'react-icons/io5';
-import { categories, formats, languages } from '../../data/links';
+import { categories, formats, languages } from '../../constant/constants';
import { BookType, MyChangeEvent } from '@components/types';
import { useUpdateBook } from '@hooks/queries';
import { ModalCropper } from '@components/modals/ModalCropper';
diff --git a/src/components/forms/NewBook.tsx b/src/components/forms/NewBook.tsx
index 0817b0a..b9a436f 100644
--- a/src/components/forms/NewBook.tsx
+++ b/src/components/forms/NewBook.tsx
@@ -23,7 +23,7 @@ import { BiImageAdd } from 'react-icons/bi';
import { FaCheckCircle } from 'react-icons/fa';
import { IoWarningSharp } from 'react-icons/io5';
-import { categories, formats, languages } from '../../data/links';
+import { categories, formats, languages } from '../../constant/constants';
import { BookType, MyChangeEvent } from '@components/types';
import { useMutatePost, useCheckUser } from '@hooks/queries';
import { ModalCropper } from '@components/modals/ModalCropper';
@@ -180,7 +180,7 @@ export function FormNewBook() {
} else if (error) {
myToast({
title: 'Ha ocurrido un error',
- description: 'No se ha podido guardar las modificaciones.',
+ description: 'No se ha podido realizar la publicación.',
icon: IoWarningSharp,
iconColor: 'red.400',
bgColor: 'black',
diff --git a/src/components/nav/DesktopNav.tsx b/src/components/nav/DesktopNav.tsx
index 4765c7b..e02765b 100644
--- a/src/components/nav/DesktopNav.tsx
+++ b/src/components/nav/DesktopNav.tsx
@@ -14,7 +14,7 @@ import {
useDisclosure,
} from '@chakra-ui/react';
-import { navLink, accountLinks } from '../../data/links';
+import { navLink, accountLinks } from '../../constant/constants';
import { MenuProfile } from '@components/nav/menu/MenuProfile';
import { InputSearch } from '@components/forms/filters/InputSearch';
import { ModalFilter } from '@components/modals/ModalFilter';
@@ -100,23 +100,28 @@ export function DesktopNav() {
- {navLink.map(({ name, href }) => (
-
-
- {name}
-
-
- ))}
+ {navLink
+ .filter(({ name }) => {
+ if (name === 'Mis favoritos' && !data) return false;
+ return true;
+ })
+ .map(({ name, href }) => (
+
+
+ {name}
+
+
+ ))}
diff --git a/src/components/nav/MobileNav.tsx b/src/components/nav/MobileNav.tsx
index cc1d841..33f2356 100644
--- a/src/components/nav/MobileNav.tsx
+++ b/src/components/nav/MobileNav.tsx
@@ -24,7 +24,7 @@ import {
DrawerFooter,
} from '@chakra-ui/react';
-import { navLink, accountLinks } from '../../data/links';
+import { navLink, accountLinks } from '../../constant/constants';
import { InputSearch } from '@components/forms/filters/InputSearch';
import { ModalFilter } from '@components/modals/ModalFilter';
import { MenuProfile } from '@components/nav/menu/MenuProfile';
@@ -196,28 +196,33 @@ export function MobileNav() {
- {navLink.map(({ icon, name, href }) => (
-
-
-
- {name}
-
-
- ))}
+ {navLink
+ .filter(({ name }) => {
+ if (name === 'Mis favoritos' && !data) return false;
+ return true;
+ })
+ .map(({ icon, name, href }) => (
+
+
+
+ {name}
+
+
+ ))}
= [
{ name: 'Inicio', href: '/', icon: GrHome },
{ name: 'Explorar', href: 'explore', icon: MdOutlineExplore },
- { name: 'Más Vistos', href: 'most-viewed', icon: ImEyePlus },
+ { name: 'Más vistos', href: 'most-viewed', icon: ImEyePlus },
+ {
+ name: 'Mis favoritos',
+ href: 'my-favorites',
+ icon: MdOutlineFavoriteBorder,
+ },
];
const accountLinks: Array = [
diff --git a/src/pages/Favorites.tsx b/src/pages/Favorites.tsx
index 8729946..a5cf071 100644
--- a/src/pages/Favorites.tsx
+++ b/src/pages/Favorites.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+import { Flex } from '@chakra-ui/react';
import { useAllFavoriteByUser } from '@hooks/queries';
import { useAuth } from '@contexts/AuthContext';
@@ -7,6 +8,9 @@ import { Card } from '@components/cards/Card';
import { CardType } from '@components/types';
import { MainHead } from '@components/layout/Head';
import { ContainerTitle } from '@components/layout/ContainerTitle';
+import { Aside } from '@components/aside/Aside';
+import { ResultLength } from '@components/aside/ResultLength';
+import { MySliderCategories } from '@components/ui/MySliderCategories';
export default function Favorites() {
const { currentUser } = useAuth();
@@ -15,41 +19,55 @@ export default function Favorites() {
return (
<>
-
-
-
- {data?.pages.map((page, index) => (
-
- {page.results.map(
- ({
- id,
- category,
- language,
- title,
- authors,
- synopsis,
- sourceLink,
- pathUrl,
- image,
- }: CardType) => (
-
-
-
- ),
- )}
-
- ))}
-
+
+
+
+
+
+
+ {data?.pages.map((page, index) => (
+
+ {page.results.map(
+ ({
+ id,
+ category,
+ language,
+ title,
+ authors,
+ synopsis,
+ sourceLink,
+ pathUrl,
+ image,
+ }: CardType) => (
+
+
+
+ ),
+ )}
+
+ ))}
+
+
>
);
}
diff --git a/src/pages/MostViewed.tsx b/src/pages/MostViewed.tsx
index 4c15cf0..0f99521 100644
--- a/src/pages/MostViewed.tsx
+++ b/src/pages/MostViewed.tsx
@@ -14,8 +14,8 @@ export default function MostViewed() {
return (
<>
-
-
+
+