-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: provide a seek pagination component
- Loading branch information
1 parent
95f9b64
commit 80db2b4
Showing
8 changed files
with
35 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,5 @@ | ||
.seek-pagination { | ||
text-align: center; | ||
font-size: 90%; | ||
margin-bottom: 20px; | ||
} |
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