Skip to content

Commit

Permalink
Fix mobile view pagination buttons (#25)
Browse files Browse the repository at this point in the history
* fix mobile view pagination

* Fix pagination buttons layout for the desktop view
  • Loading branch information
ilyalyudevig authored Oct 28, 2024
1 parent d39483f commit 821d4ab
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@

.button {
margin-right: auto;
min-width: 230px;
min-width: 250px;
font-weight: 400;
}

.icon {
Expand Down
25 changes: 24 additions & 1 deletion features/issues/components/issue-list/issue-list.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,36 @@
.container {
display: none;
}

.paginationContainer {
display: flex;
flex-direction: column;
padding: 0 0 space.$s3 0;
}

.paginationButtons {
display: flex;
justify-content: space-between;
width: 100%;
}

.paginationButton {
width: 50%;
}

.pageInfo {
margin: space.$s4 0;
}
}

@media (min-width: breakpoint.$desktop) {
.mobileContainer {
display: none;
}

.paginationContainer {
padding: space.$s4 0;
}
}
}

Expand Down Expand Up @@ -58,7 +82,6 @@
align-items: center;
justify-content: space-between;
padding: space.$s4 space.$s6;
border-top: 1px solid color.$gray-200;
}

.paginationButton {
Expand Down
42 changes: 21 additions & 21 deletions features/issues/components/issue-list/issue-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,27 +129,27 @@ export function IssueList() {
))}
</tbody>
</table>
<div className={styles.paginationContainer}>
<div>
<button
className={styles.paginationButton}
onClick={() => navigateToPage(page - 1)}
disabled={page === 1}
>
Previous
</button>
<button
className={styles.paginationButton}
onClick={() => navigateToPage(page + 1)}
disabled={page === meta?.totalPages}
>
Next
</button>
</div>
<div className={styles.pageInfo}>
Page <span className={styles.pageNumber}>{meta?.currentPage}</span>{" "}
of <span className={styles.pageNumber}>{meta?.totalPages}</span>
</div>
</div>
<div className={styles.paginationContainer}>
<div className={styles.paginationButtons}>
<button
className={styles.paginationButton}
onClick={() => navigateToPage(page - 1)}
disabled={page === 1}
>
Previous
</button>
<button
className={styles.paginationButton}
onClick={() => navigateToPage(page + 1)}
disabled={page === meta?.totalPages}
>
Next
</button>
</div>
<div className={styles.pageInfo}>
Page <span className={styles.pageNumber}>{meta?.currentPage}</span> of{" "}
<span className={styles.pageNumber}>{meta?.totalPages}</span>
</div>
</div>
</div>
Expand Down

0 comments on commit 821d4ab

Please sign in to comment.