mirror of
https://github.com/zadam/trilium.git
synced 2026-02-19 20:24:28 +01:00
ui/pager: add prev/next page navigation buttons
This commit is contained in:
parent
7551d0e044
commit
b8bc85856b
@ -2191,7 +2191,9 @@
|
||||
},
|
||||
"pagination": {
|
||||
"page_title": "Page of {{startIndex}} - {{endIndex}}",
|
||||
"total_notes": "{{count}} notes"
|
||||
"total_notes": "{{count}} notes",
|
||||
"prev_page": "Previous page",
|
||||
"next_page": "Next page"
|
||||
},
|
||||
"collections": {
|
||||
"rendering_error": "Unable to show content due to an error."
|
||||
|
||||
@ -4,6 +4,7 @@ import FNote from "../../entities/fnote";
|
||||
import froca from "../../services/froca";
|
||||
import { useNoteLabelInt } from "../react/hooks";
|
||||
import { t } from "../../services/i18n";
|
||||
import ActionButton from "../react/ActionButton";
|
||||
|
||||
interface PaginationContext {
|
||||
page: number;
|
||||
@ -50,7 +51,21 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit<P
|
||||
|
||||
return (
|
||||
<div class="note-list-pager">
|
||||
<ActionButton
|
||||
icon="bx bx-caret-left"
|
||||
disabled={(page === 1)}
|
||||
text={t("pagination.prev_page")}
|
||||
onClick={() => {setPage(--page)}}
|
||||
/>
|
||||
|
||||
{children}
|
||||
|
||||
<ActionButton
|
||||
icon="bx bx-caret-right"
|
||||
disabled={(page === pageCount)}
|
||||
text={t("pagination.next_page")}
|
||||
onClick={() => {setPage(++page)}}
|
||||
/>
|
||||
|
||||
<span className="note-list-pager-total-count">({t("pagination.total_notes", { count: totalNotes })})</span>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user