Skip to content

Commit

Permalink
chore: improvements in the Views component and other corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Franqsanz committed Aug 27, 2024
1 parent 62f55d9 commit 3e32cb1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/cards/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ export function Card({
align='center'
mt='2'
px='7'
fontSize={{ base: '0.55rem', sm: 'xs' }}
color={colorAuthorCard}
views={views}
bxSize='4'
/>
)}
</Flex>
Expand Down
6 changes: 3 additions & 3 deletions src/components/ui/Views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React from 'react';
import { Flex, Icon } from '@chakra-ui/react';
import { ImEye } from 'react-icons/im';

export function Views({ views, ...props }: any) {
export function Views({ views, bxSize, ...props }: any) {
return (
<>
<Flex {...props}>
<Icon as={ImEye} boxSize='5' mr='2' />
<Flex fontSize='sm' {...props}>
<Icon as={ImEye} boxSize={bxSize} mr='2' />
{views}
</Flex>
</>
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ function useMoreBooksAuthors(id: string | undefined) {

function useBook(pathUrl: string | undefined, token?: string | null) {
return useSuspenseQuery({
queryKey: [keys.one, pathUrl, token],
queryKey: [keys.one, pathUrl],
queryFn: () => getBook(pathUrl, token),
refetchOnWindowFocus: false,
gcTime: 3000,
retry: 1,
retry: false,
});
}

Expand Down
5 changes: 2 additions & 3 deletions src/pages/Book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
} from 'react-icons/fi';
import { BsTag } from 'react-icons/bs';
import { FaCheckCircle } from 'react-icons/fa';
import { ImEye } from 'react-icons/im';
import LazyLoad from 'react-lazy-load';
import Atropos from 'atropos/react';
import 'atropos/css';
Expand Down Expand Up @@ -266,8 +265,8 @@ export default function Book() {
left='0'
right='0'
position='absolute'
fontSize='sm'
views={data.views}
bxSize='5'
/>
</Box>
<Flex
Expand Down Expand Up @@ -494,8 +493,8 @@ export default function Book() {
left='0'
right='0'
position='absolute'
fontSize='sm'
views={data.views}
bxSize='5'
/>
<Box
w='290px'
Expand Down

0 comments on commit 3e32cb1

Please sign in to comment.