Skip to content

Commit

Permalink
chore: folder organization within components has been improved
Browse files Browse the repository at this point in the history
  • Loading branch information
Franqsanz committed Aug 20, 2024
1 parent 2fc6acb commit 67ec6e3
Show file tree
Hide file tree
Showing 35 changed files with 47 additions and 56 deletions.
8 changes: 4 additions & 4 deletions src/components/AllBooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import { useInView } from 'react-intersection-observer';
import { CardType } from '@components/types';
import { useBooksPaginate } from '@hooks/queries';
import { useScrollRestoration } from '@hooks/useScrollRestoration';
import { MySimpleGrid } from '@components/MySimpleGrid';
import { MySimpleGrid } from '@components/ui/MySimpleGrid';
import { Card } from '@components/cards/Card';
import { Aside } from '@components/Aside';
import { Aside } from '@components/aside/Aside';
import { SkeletonAllBooks } from '@components/skeletons/SkeletonABooks';
import { ResultLength } from '@components/ResultLength';
import { MostViewed } from '@components/MostViewed';
import { ResultLength } from '@components/aside/ResultLength';
import { MostViewed } from '@components/aside/MostViewed';

export function AllBooks() {
const { ref, inView } = useInView();
Expand Down
2 changes: 1 addition & 1 deletion src/components/Categories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NavLink } from 'react-router-dom';
import { Link } from '@chakra-ui/react';
import { BsTag } from 'react-icons/bs';

import { MyTag } from '@components/MyTag';
import { MyTag } from '@components/ui/MyTag';
import { useAllFilterOptions } from '@hooks/queries';

export default function Categories() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Box, Text } from '@chakra-ui/react';

import { aboutCategories } from '../data/links';
import { aboutCategories } from '../../data/links';

export function AboutCategories({ category }: any) {
const filteredAboutCategories = aboutCategories.filter((item) => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/cards/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { BsTag } from 'react-icons/bs';
import { IoLanguageOutline } from 'react-icons/io5';

import { CardType } from '@components/types';
import { MyTag } from '@components/MyTag';
import { MyTag } from '@components/ui/MyTag';
import { handleImageLoad, useHandleEnterKey, isSpanish } from '@utils/utils';

export function Card({
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/FormEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { BookType, MyChangeEvent } from '@components/types';
import { useUpdateBook } from '@hooks/queries';
import { ModalCropper } from '@components/modals/ModalCropper';
import { sortArrayByLabel } from '@utils/utils';
import { MyPopover } from '@components/MyPopover';
import { MyPopover } from '@components/ui/MyPopover';
import {
handleInputChange,
handleCategory,
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/NewBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { useMutatePost, useCheckUser } from '@hooks/queries';
import { ModalCropper } from '@components/modals/ModalCropper';
import { sortArrayByLabel } from '@utils/utils';
import { useGenerateSlug } from '@hooks/useGenerateSlug';
import { MyPopover } from '@components/MyPopover';
import { MyPopover } from '@components/ui/MyPopover';
import {
handleInputChange,
handleCategory,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/components/skeletons/SkeletonABooks.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { Skeleton, SkeletonText, Flex, Box, Stack } from '@chakra-ui/react';

import { MySimpleGrid } from '@components/MySimpleGrid';
import { Aside } from '@components/Aside';
import { MySimpleGrid } from '@components/ui/MySimpleGrid';
import { Aside } from '@components/aside/Aside';
import { SkeletonTags } from '@components/skeletons/SkeletonTags';
import { SkeletonType } from '@components/types';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pages/404.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NavLink } from 'react-router-dom';
import { Link, Text, VStack, Box, Image, Flex, Icon } from '@chakra-ui/react';
import { FiArrowLeft } from 'react-icons/fi';

import { MainHead } from '@components/Head';
import { MainHead } from '@components/layout/Head';
import { PageNotFound } from '@assets/assets';

export function ErrorPage() {
Expand Down
8 changes: 4 additions & 4 deletions src/pages/Book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import 'atropos/css';

import { useBook, useDeleteBook } from '@hooks/queries';
import { handleImageLoad } from '@utils/utils';
import { MainHead } from '@components/Head';
import { MyTag } from '@components/MyTag';
import { MainHead } from '@components/layout/Head';
import { MyTag } from '@components/ui/MyTag';
import { ModalShare } from '@components/modals/ModalShare';
import { MyLink } from '@components/MyLink';
import { MyLink } from '@components/ui/MyLink';
import { BooksSection } from '@components/BooksSection';
import { ImageZoom } from '@components/ImageZoom';
import { ImageZoom } from '@components/ui/ImageZoom';
import { ModalOptions } from '@components/modals/ModalOptions';
import { ModalConfirmation } from '@components/modals/ModalConfirmation';
import { ModalForm } from '@components/modals/ModalForm';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CreateUser.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { FormCreateUser } from '@components/forms/FormCreateUser';
import { MainHead } from '@components/Head';
import { MainHead } from '@components/layout/Head';

export function CreateUser() {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Explore.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';

import { AllBooks } from '@components/AllBooks';
import { ContainerTitle } from '@components/ContainerTitle';
import { MySliderCategories } from '@components/MySliderCategories';
import { MainHead } from '@components/Head';
import { ContainerTitle } from '@components/layout/ContainerTitle';
import { MySliderCategories } from '@components/ui/MySliderCategories';
import { MainHead } from '@components/layout/Head';

export default function Explore() {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
useBreakpointValue,
} from '@chakra-ui/react';

import { MainHead } from '@components/Head';
import { MainHead } from '@components/layout/Head';
import { useAuth } from '@contexts/AuthContext';
import {
PatternPadWhite,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import { Box, Flex, Button, Stack } from '@chakra-ui/react';
import { BsFacebook, BsTwitterX } from 'react-icons/bs';

import { ContainerTitle } from '@components/ContainerTitle';
import { MainHead } from '@components/Head';
import { ContainerTitle } from '@components/layout/ContainerTitle';
import { MainHead } from '@components/layout/Head';
import { SignIn } from '@services/auth/auth';

export function Login() {
Expand Down
8 changes: 4 additions & 4 deletions src/pages/MostViewed.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import { Flex } from '@chakra-ui/react';

import { MainHead } from '@components/Head';
import { ContainerTitle } from '@components/ContainerTitle';
import { MySimpleGrid } from '@components/MySimpleGrid';
import { MainHead } from '@components/layout/Head';
import { ContainerTitle } from '@components/layout/ContainerTitle';
import { MySimpleGrid } from '@components/ui/MySimpleGrid';
import { Card } from '@components/cards/Card';
import { CardType } from '@components/types';
import { useMostViewedBooks } from '@hooks/queries';
import { MySliderCategories } from '@components/MySliderCategories';
import { MySliderCategories } from '@components/ui/MySliderCategories';

export default function MostViewed() {
const { data } = useMostViewedBooks('full');
Expand Down
4 changes: 2 additions & 2 deletions src/pages/NewBook.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';

import { FormNewBook } from '@components/forms/NewBook';
import { MainHead } from '@components/Head';
import { ContainerTitle } from '@components/ContainerTitle';
import { MainHead } from '@components/layout/Head';
import { ContainerTitle } from '@components/layout/ContainerTitle';

export default function NewBook() {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/PrivacyPolicies.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { Box, Flex, Text, Link } from '@chakra-ui/react';

import { ContainerTitle } from '@components/ContainerTitle';
import { MainHead } from '@components/Head';
import { ContainerTitle } from '@components/layout/ContainerTitle';
import { MainHead } from '@components/layout/Head';

export default function PrivacyPolicies() {
return (
Expand Down
14 changes: 7 additions & 7 deletions src/pages/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import { Card } from '@components/cards/Card';
import { CardType } from '@components/types';
import { useFilter, useFilterPaginated } from '@hooks/queries';
import { useScrollRestoration } from '@hooks/useScrollRestoration';
import { ContainerTitle } from '@components/ContainerTitle';
import { MySimpleGrid } from '@components/MySimpleGrid';
import { MainHead } from '@components/Head';
import { Aside } from '@components/Aside';
import { MySliderCategories } from '@components/MySliderCategories';
import { ContainerTitle } from '@components/layout/ContainerTitle';
import { MySimpleGrid } from '@components/ui/MySimpleGrid';
import { MainHead } from '@components/layout/Head';
import { Aside } from '@components/aside/Aside';
import { MySliderCategories } from '@components/ui/MySliderCategories';
import { FilterDrawer } from '@components/FilterDrawer';
import { ResultLength } from '@components/ResultLength';
import { AboutCategories } from '@components/AboutCategories';
import { ResultLength } from '@components/aside/ResultLength';
import { AboutCategories } from '@components/aside/AboutCategories';
import { Lost } from '@assets/assets';
import { aboutCategories } from '../data/links';
import { SkeletonAllBooks } from '@components/skeletons/SkeletonABooks';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Outlet } from 'react-router-dom';

import { SkeletonMain } from '@components/skeletons/SkeletonMain';
import { Nav } from '@components/nav/Nav';
import { Footer } from '@components/Footer';
import { Footer } from '@components/layout/Footer';

export function Layout() {
return (
Expand Down
8 changes: 4 additions & 4 deletions src/pages/profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import { AiOutlineCloudUpload } from 'react-icons/ai';
import { useInView } from 'react-intersection-observer';
// import Cookies from 'js-cookie';

import { MySimpleGrid } from '@components/MySimpleGrid';
import { MySimpleGrid } from '@components/ui/MySimpleGrid';
import { Card } from '@components/cards/Card';
import { Aside } from '@components/Aside';
import { MainHead } from '@components/Head';
import { Aside } from '@components/aside/Aside';
import { MainHead } from '@components/layout/Head';
import { useProfile } from '@hooks/queries';
import { parseDate } from '@utils/utils';
import { CardType } from '@components/types';
import { ResultLength } from '@components/ResultLength';
import { ResultLength } from '@components/aside/ResultLength';
import { useAuth } from '@contexts/AuthContext';
import { NoData } from '@assets/assets';
import { SkeletonAllBooks } from '@components/skeletons/SkeletonABooks';
Expand Down
4 changes: 2 additions & 2 deletions src/pages/profile/account/MyAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import {
// import { MySimpleGrid } from '@components/MySimpleGrid';
// import { Card } from '@components/cards/Card';
// import { Aside } from '@components/Aside';
import { MainHead } from '@components/Head';
import { MainHead } from '@components/layout/Head';
// import { useProfile } from '@hooks/queries';
// import { parseDate } from '@utils/utils';
// import { CardType } from '@components/types';
// import ResultLength from '@components/ResultLength';
// import { useAuth } from '@contexts/AuthContext';
import { useAccountActions } from '@hooks/useAccountActions';
import { ContainerTitle } from '@components/ContainerTitle';
import { ContainerTitle } from '@components/layout/ContainerTitle';
import { ModalConfirmation } from '@components/modals/ModalConfirmation';
// import { logOut } from '../../services/firebase/auth';

Expand Down
2 changes: 1 addition & 1 deletion src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ErrorPage } from '@pages/404';
import { Layout } from '@pages/layout/Layout';
import { SkeletonAllBooks } from '@components/skeletons/SkeletonABooks';
import { SkeletonDetailsBook } from '@components/skeletons/SkeletonDBook';
import { PrivateRoute } from '@components/PrivateRoute';
import { PrivateRoute } from '@components/nav/PrivateRoute';

import { MyAccount } from '@pages/profile/account/MyAccount';
import { Profile } from '@pages/profile/Profile';
Expand Down
11 changes: 1 addition & 10 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function generatePathUrl(name: string) {
const formattedName = name
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f()°º:]/g, '');
.replace(/[\u0300-\u036f()°º:,]/g, '');
const withoutDotsName = formattedName.replace(/\.|\//g, '');
const withoutQuestionMarks = withoutDotsName.replace(/[?¿]/g, '');
const dashedName = withoutQuestionMarks.replace(/\s+/g, '-');
Expand All @@ -54,15 +54,6 @@ function generatePathUrl(name: string) {
return `${dashedName}-${randomId}`;
}

// function aboutAuthors(authorNames: string[]) {
// const authorLinks = authorNames.map((authorName) => {
// const encodedAuthorName = encodeURIComponent(authorName);
// return `https://www.google.com/search?q=${encodedAuthorName}+escritor`;
// });

// return authorLinks;
// }

// Funcion para verificar si se encuentra en otro idioma que no sea español
function isSpanish(language) {
const spanishLanguage = ['Español', 'español'];
Expand Down

0 comments on commit 67ec6e3

Please sign in to comment.