Skip to content

Commit

Permalink
2345
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjaqbek committed Jul 15, 2024
1 parent addf7c3 commit 45be83b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/LeaderboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ const LeaderboardPage: React.FC<LeaderboardPageProps> = ({ elapsedTime, onClose
<StyledButton onClick={handleSaveScore} style={{ marginBottom: '10px' }}>Save Score</StyledButton>
<StyledButton onClick={onClose}>Close</StyledButton>
</ActionsContainer>
<ActionsContainer>
{pageIndex > 0 && (
<StyledButtonSecondary onClick={handlePrevPage}>Previous</StyledButtonSecondary>
)}
</ActionsContainer>
<LeaderboardList>
{paginatedScores.map((entry, index) => (
<LeaderboardItem key={index}>
Expand All @@ -202,11 +207,8 @@ const LeaderboardPage: React.FC<LeaderboardPageProps> = ({ elapsedTime, onClose
))}
</LeaderboardList>
<ActionsContainer>
{pageIndex > 0 && (
<StyledButtonSecondary onClick={handlePrevPage}>Previous</StyledButtonSecondary>
)}
{(pageIndex + 1) * itemsPerPage < topScores.length && (
<StyledButtonSecondary onClick={handleNextPage}>Load More</StyledButtonSecondary>
<StyledButtonSecondary onClick={handleNextPage}>Next</StyledButtonSecondary>
)}
</ActionsContainer>
</LeaderboardContent>
Expand Down

0 comments on commit 45be83b

Please sign in to comment.