mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
fix: next button disabled state in paginated rows view
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9791 GitOrigin-RevId: 953433a8c4bc3dfddb38a141c5e7d079a6da3618
This commit is contained in:
parent
7d35304816
commit
7f2fa266e6
@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import { Button } from '../Button';
|
||||
import { inputStyles } from '../../components/Services/Events/constants';
|
||||
|
||||
@ -13,6 +12,7 @@ export type PaginationWithOnlyNavProps = {
|
||||
export const PaginationWithOnlyNav = (props: PaginationWithOnlyNavProps) => {
|
||||
const { offset, limit, changePage, changePageSize, rows } = props;
|
||||
const newPage = offset / limit;
|
||||
const isNextEnabled = rows.length === limit;
|
||||
return (
|
||||
<div className="flex ml-sm mr-sm mb-sm mt-sm justify-around max-w-5xl">
|
||||
<div>
|
||||
@ -48,7 +48,7 @@ export const PaginationWithOnlyNav = (props: PaginationWithOnlyNavProps) => {
|
||||
<div>
|
||||
<Button
|
||||
onClick={() => changePage(newPage + 1)}
|
||||
disabled={rows.length === 0}
|
||||
disabled={rows.length === 0 || !isNextEnabled}
|
||||
data-test="custom-pagination-next"
|
||||
>
|
||||
Next
|
||||
|
Loading…
Reference in New Issue
Block a user