Skip to content

Commit

Permalink
fix pagination: mobile view
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshuxkumar committed Feb 5, 2025
1 parent b514175 commit 18b8a55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type IButtonProps = {
// eslint-disable-next-line prettier/prettier

/** The text to be displayed on the button. */
text: string;
text: string | React.ReactNode;

/** The type of the button. Defaults to 'button'. */
type?: ButtonType;
Expand Down
14 changes: 7 additions & 7 deletions components/pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@ export default function Pagination({ totalPages, currentPage, onPageChange }: Pa
pages.push(i);
}

if (currentPage < totalPages - 2) {
pages.push('ellipsis2');
}

pages.push(totalPages);

return pages;
};

return (
<nav role='navigation' aria-label='Pagination' className='font-inter flex items-center justify-center gap-8'>
<nav
role='navigation'
aria-label='Pagination'
className='font-inter flex min-w-[326px] items-center justify-center md:gap-8'
>
{/* Previous button */}
<Button
onClick={() => handlePageChange(currentPage - 1)}
disabled={currentPage === 1}
className={`font-normal flex h-[34px] items-center justify-center rounded bg-white px-3 py-[7px] text-sm leading-[17px] tracking-[-0.01em] ${
currentPage === 1 ? 'hover:bg-gray-white cursor-not-allowed text-gray-300' : 'text-[#141717] hover:bg-gray-50'
}`}
text='Previous'
text={<span className='hidden md:inline'>Previous</span>}
icon={<IconPrevious />}
iconPosition={ButtonIconPosition.LEFT}
aria-label='Go to previous page'
Expand Down Expand Up @@ -108,7 +108,7 @@ export default function Pagination({ totalPages, currentPage, onPageChange }: Pa
? 'hover:bg-gray-white cursor-not-allowed text-gray-300'
: 'text-[#141717] hover:bg-gray-50'
}`}
text='Next'
text={<span className='hidden md:inline'>Next</span>}
icon={<IconNext />}
aria-label='Go to next page'
/>
Expand Down

0 comments on commit 18b8a55

Please sign in to comment.