diff --git a/src/client/components/Library/Library.tsx b/src/client/components/Library/Library.tsx index 7e540df..b53911c 100644 --- a/src/client/components/Library/Library.tsx +++ b/src/client/components/Library/Library.tsx @@ -48,10 +48,15 @@ export const Library = (): ReactElement => { const T2Table = (tableOptions): ReactElement => { const { columns, totalPages, rowClickHandler } = tableOptions; - + const [{ pageIndex, pageSize }, setPagination] = + React.useState({ + pageIndex: 1, + pageSize: 25, + }) // pagination methods const goToNextPage = useCallback((pageIndex, pageSize) => { + table.setPageIndex(pageSize); dispatch( searchIssue( { @@ -71,6 +76,8 @@ export const Library = (): ReactElement => { const goToPreviousPage = useCallback((pageIndex, pageSize) => { + console.log("papsdas", pageIndex); + // table.setPageIndex(pageIndex + 1) let from = 0; if (pageIndex === 2) { from = (pageIndex - 1) * pageSize + 2 - 27; @@ -109,6 +116,18 @@ export const Library = (): ReactElement => { return ( <> + {/* pagination control */} + {table.getHeaderGroups().map((headerGroup, idx) => ( @@ -148,18 +167,7 @@ export const Library = (): ReactElement => {
- {/* pagination control */} - + ); @@ -281,6 +289,7 @@ export const Library = (): ReactElement => {

Library

{/* Search bar */} + {!isUndefined(searchResults.hits) && (
diff --git a/src/client/components/Library/SearchBar.tsx b/src/client/components/Library/SearchBar.tsx index 3e75712..39d2190 100644 --- a/src/client/components/Library/SearchBar.tsx +++ b/src/client/components/Library/SearchBar.tsx @@ -21,6 +21,7 @@ export const SearchBar = (): ReactElement => { from: 0, }, type: "volumeName", + trigger: "libraryPage", }, ), );