diff --git a/explorer/src/components/block/BlockRewardsCard.tsx b/explorer/src/components/block/BlockRewardsCard.tsx index a6a6e504f..1b3ec4322 100644 --- a/explorer/src/components/block/BlockRewardsCard.tsx +++ b/explorer/src/components/block/BlockRewardsCard.tsx @@ -3,7 +3,11 @@ import { lamportsToSolString } from "utils"; import { ConfirmedBlock, PublicKey } from "@solana/web3.js"; import { Address } from "components/common/Address"; +const PAGE_SIZE = 10; + export function BlockRewardsCard({ block }: { block: ConfirmedBlock }) { + const [rewardsDisplayed, setRewardsDisplayed] = React.useState(PAGE_SIZE); + if (block.rewards.length < 1) { return null; } @@ -26,7 +30,11 @@ export function BlockRewardsCard({ block }: { block: ConfirmedBlock }) {
- {block.rewards.map((reward) => { + {block.rewards.map((reward, index) => { + if (index >= rewardsDisplayed - 1) { + return null; + } + let percentChange; if (reward.postBalance !== null && reward.postBalance !== 0) { percentChange = ( @@ -54,6 +62,19 @@ export function BlockRewardsCard({ block }: { block: ConfirmedBlock }) { + + {block.rewards.length > rewardsDisplayed && ( +