-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: provide a seek pagination component
- Loading branch information
1 parent
95f9b64
commit 36c2d62
Showing
8 changed files
with
58 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{#if @pagination.nextPage}} | ||
<nav local-class='seek-pagination' aria-label="Pagination navigation"> | ||
<LinkTo @query={{hash seek=@pagination.nextPage}} local-class="next" rel="next" title="Goes to next page" data-test-pagination-next> | ||
Next Page | ||
</LinkTo> | ||
</nav> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.seek-pagination { | ||
text-align: center; | ||
font-size: 90%; | ||
margin-bottom: 20px; | ||
|
||
ol { | ||
list-style: none; | ||
padding: 0; | ||
} | ||
ol, li { display: inline; } | ||
|
||
a { | ||
color: var(--main-color-light); | ||
text-decoration: none; | ||
padding: 5px 6px; | ||
} | ||
a:hover { background-color: var(--main-bg-dark); } | ||
a:global(.active) { background-color: var(--main-bg-dark); } | ||
|
||
img, svg { vertical-align: middle; } | ||
|
||
.next:global(.active), | ||
.prev:global(.active), | ||
.next:hover, | ||
.prev:hover { | ||
background: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
import Controller from '@ember/controller'; | ||
import { tracked } from '@glimmer/tracking'; | ||
|
||
import { reads } from 'macro-decorators'; | ||
|
||
import { pagination } from '../../utils/seek'; | ||
import { pagination } from '../../utils/seek-pagination'; | ||
|
||
export default class PendingInvitesController extends Controller { | ||
queryParams = ['seek']; | ||
@tracked seek = 'WzEsIDFd'; | ||
|
||
@reads('model.meta.total') totalItems; | ||
@reads('model.meta.next_page') nextPage; | ||
@pagination() pagination; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import macro from 'macro-decorators'; | ||
|
||
export function pagination() { | ||
return macro(function () { | ||
let { nextPage, totalItems } = this; | ||
|
||
return { | ||
nextPage, | ||
totalItems, | ||
}; | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters