Skip to content

Commit

Permalink
Make previous/next buttons on left/right of screen
Browse files Browse the repository at this point in the history
  • Loading branch information
chennisden committed Aug 6, 2024
1 parent 7f72c07 commit 47d16d9
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions frontend/src/pages/Browse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,22 @@ const Browse = () => {

{hasButton && (
<div className="flex justify-center mt-4">
<div className="inline-flex">
{prevButton && (
<button
className="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded-l"
onClick={() => navigate(`/browse/${pageNumber - 1}`)}
>
Previous
</button>
)}
{nextButton && (
<button
className="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded-r"
onClick={() => navigate(`/browse/${pageNumber + 1}`)}
>
Next
</button>
)}
</div>
{prevButton && (
<button
className="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded-l mr-auto"
onClick={() => navigate(`/browse/${pageNumber - 1}`)}
>
Previous
</button>
)}
{nextButton && (
<button
className="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded-r ml-auto"
onClick={() => navigate(`/browse/${pageNumber + 1}`)}
>
Next
</button>
)}
</div>
)}
</div>
Expand Down

0 comments on commit 47d16d9

Please sign in to comment.