1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

25 items per page, prepare dynamic updating of offset

This commit is contained in:
Matthias Kretschmann 2019-04-05 15:20:38 +02:00
parent 2b7be08d20
commit 410a49f1dc
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -15,6 +15,7 @@ interface SearchProps {
interface SearchState { interface SearchState {
results: any[] results: any[]
offset: number
totalPages: number totalPages: number
currentPage: number currentPage: number
isLoading: boolean isLoading: boolean
@ -23,6 +24,7 @@ interface SearchState {
export default class Search extends PureComponent<SearchProps, SearchState> { export default class Search extends PureComponent<SearchProps, SearchState> {
public state = { public state = {
results: [], results: [],
offset: 25,
totalPages: 1, totalPages: 1,
currentPage: 1, currentPage: 1,
isLoading: true isLoading: true
@ -37,7 +39,7 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
private searchAssets = async () => { private searchAssets = async () => {
const searchQuery = { const searchQuery = {
offset: 100, offset: this.state.offset,
page: this.state.currentPage, page: this.state.currentPage,
query: { query: {
text: [this.searchTerm], text: [this.searchTerm],