working paginator

This commit is contained in:
Evert Prants 2022-09-09 17:40:19 +03:00
parent 0a90ca6bb9
commit 409b512886
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
3 changed files with 11 additions and 6 deletions

View File

@ -2,11 +2,10 @@
appearance: none; appearance: none;
padding: 0.5rem 1.5rem; padding: 0.5rem 1.5rem;
border-radius: 4px; border-radius: 4px;
cursor: pointer;
transition: background linear 0.33s; transition: background linear 0.33s;
&[disabled] { &:not([disabled]) {
cursor: default; cursor: pointer;
} }
&.default { &.default {

View File

@ -10,13 +10,19 @@
&.previous { &.previous {
border-top-left-radius: 8px; border-top-left-radius: 8px;
border-bottom-left-radius: 8px; border-bottom-left-radius: 8px;
border-right: 0;
} }
&.next { &.next {
border-top-right-radius: 8px; border-top-right-radius: 8px;
border-bottom-right-radius: 8px; border-bottom-right-radius: 8px;
border-left: 0; }
&:not(:last-of-type) {
border-right: 0;
}
&:not([disabled]) {
cursor: pointer;
} }
} }
} }

View File

@ -37,7 +37,7 @@ export const Paginator = ({
<button <button
className={[styles.pageButton, styles.next].join(' ')} className={[styles.pageButton, styles.next].join(' ')}
onClick={() => setPage(pagination.page + 1)} onClick={() => setPage(pagination.page + 1)}
disabled={pagination.page + 1 >= pagination.pageCount} disabled={pagination.page + 1 > pagination.pageCount}
> >
Next Next
</button> </button>