Skip to content

Commit

Permalink
fix: backend data changes
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaT82 committed Feb 28, 2024
1 parent 99bd129 commit 78fafcf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/routes/Blocks/Inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ function Inputs({ blockHeight }: { blockHeight: string }) {
};

const itemsPerPage = 5;
const totalItems = data?.block.body.inputs.length || 0;
const totalItems = data?.body.inputs.length || 0;
const totalPages = Math.ceil(totalItems / itemsPerPage);
const startIndex = (page - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const displayedItems = data?.block.body.inputs.slice(startIndex, endIndex);
const displayedItems = data?.body.inputs.slice(startIndex, endIndex);

const renderItems = displayedItems?.map((content: any, index: number) => {
const adjustedIndex = startIndex + index;
Expand Down
4 changes: 2 additions & 2 deletions src/routes/Blocks/Kernels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ function Kernels({ blockHeight }: { blockHeight: string }) {
};

const itemsPerPage = 5;
const totalItems = data?.block.body.kernels.length || 0;
const totalItems = data?.body.kernels.length || 0;
const totalPages = Math.ceil(totalItems / itemsPerPage);
const startIndex = (page - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const displayedItems = data?.block.body.kernels.slice(startIndex, endIndex);
const displayedItems = data?.body.kernels.slice(startIndex, endIndex);

const renderItems = displayedItems?.map((content: any, index: number) => {
const adjustedIndex = startIndex + index;
Expand Down
4 changes: 2 additions & 2 deletions src/routes/Blocks/Outputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ function Outputs({ blockHeight }: { blockHeight: string }) {
};

const itemsPerPage = 5;
const totalItems = data?.block.body.outputs.length || 0;
const totalItems = data?.body.outputs.length || 0;
const totalPages = Math.ceil(totalItems / itemsPerPage);
const startIndex = (page - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const displayedItems = data?.block.body.outputs.slice(startIndex, endIndex);
const displayedItems = data?.body.outputs.slice(startIndex, endIndex);

const renderItems = displayedItems?.map((content: any, index: number) => {
const adjustedIndex = startIndex + index;
Expand Down

0 comments on commit 78fafcf

Please sign in to comment.