diff --git a/components/RoundStatus/index.tsx b/components/RoundStatus/index.tsx index aeaba3b5..a8ab84d6 100644 --- a/components/RoundStatus/index.tsx +++ b/components/RoundStatus/index.tsx @@ -39,12 +39,12 @@ const Index = ({ const blocksRemaining = useMemo( () => - currentRoundInfo?.initialized && protocol - ? +protocol.roundLength - - (+Number(currentRoundInfo.currentL1Block) - - +Number(currentRoundInfo.startBlock)) + currentRoundInfo?.initialized + ? currentRoundInfo.roundLength - + (Number(currentRoundInfo.currentL1Block) - + Number(currentRoundInfo.startBlock)) : 0, - [protocol, currentRoundInfo] + [currentRoundInfo] ); const timeRemaining = useMemo( () => AVERAGE_L1_BLOCK_TIME * blocksRemaining, @@ -61,19 +61,13 @@ const Index = ({ const percentage = useMemo( () => - protocol - ? (blocksSinceCurrentRoundStart / +protocol.roundLength) * 100 + currentRoundInfo?.roundLength + ? (blocksSinceCurrentRoundStart / currentRoundInfo.roundLength) * 100 : 0, - [blocksSinceCurrentRoundStart, protocol] + [blocksSinceCurrentRoundStart, currentRoundInfo] ); - const isRoundLocked = useMemo( - () => - protocol && currentRoundInfo - ? blocksRemaining <= Number(protocol?.lockPeriod) - : false, - [protocol, blocksRemaining, currentRoundInfo] - ); + const isRoundLocked = currentRoundInfo?.locked ?? false; const rewardTokensClaimed = useMemo( () => @@ -126,50 +120,54 @@ const Index = ({ {currentRoundInfo?.id ? `#${currentRoundInfo.id}` : ""} - - {!isRoundLocked - ? "The current round is ongoing and orchestrators can currently update their parameters." - : "The current round is locked, which means that orchestrator parameters cannot be updated until the next round begins."} - - } - > - - - {!isRoundLocked ? "Initialized " : "Locked "} - - - {isRoundLocked ? ( - - ) : ( - + ) : ( + + {!isRoundLocked + ? "The current round is ongoing and orchestrators can currently update their parameters." + : "The current round is locked, which means that orchestrator parameters cannot be updated until the next round begins."} + + } + > + + - )} - - + > + {!isRoundLocked ? "Initialized " : "Locked "} + + + {isRoundLocked ? ( + + ) : ( + + )} + + + )} - {!currentRoundInfo || !protocol ? ( + {!currentRoundInfo ? ( - of {protocol.roundLength} blocks + of {currentRoundInfo.roundLength} blocks @@ -259,212 +257,218 @@ const Index = ({ begins. - - The amount of fees that have been paid out in the current - round. Equivalent to{" "} - {formatUSD(protocol?.currentRound?.volumeUSD, { - precision: 0, - abbreviate: true, - })}{" "} - at recent prices of ETH. - - } - > - - - - Fees - - - - - - - - {formatETH(protocol?.currentRound?.volumeETH, { - precision: 2, - })} - - - - - The amount of rewards which have been claimed by orchestrators - in the current round. - - } - > - - + + The amount of fees that have been paid out in the current + round. Equivalent to{" "} + {formatUSD(protocol?.currentRound?.volumeUSD, { + precision: 0, + abbreviate: true, + })}{" "} + at recent prices of ETH. + + } > - - Rewards - - - - - + + + Fees + + + + + - - {rewards} - - - - - The current total supply of LPT.} - > - + {formatETH(protocol?.currentRound?.volumeETH, { + precision: 2, + })} + + + + + The amount of rewards which have been claimed by + orchestrators in the current round. + + } > + + + Rewards + + + + + + - Total Supply + {rewards} - - - - - - {totalSupply !== null - ? formatLPT(totalSupply, { - precision: 0, - abbreviate: true, - }) - : "--"} - - - - Total supply change over the past 365 days.} - > - + - The current total supply of LPT.} > - - Supply Change (1Y) - - - - - + + + Total Supply + + + + + - + {totalSupply !== null + ? formatLPT(totalSupply, { + precision: 0, + abbreviate: true, + }) + : "--"} + + + + Total supply change over the past 365 days. + } > - {isSupplyChangeLoading ? ( - - ) : supplyChangeData?.supplyChange != null ? ( - formatPercent(supplyChangeData.supplyChange, { - precision: 2, - }) - ) : ( - "--" - )} - - - - + + + + Supply Change (1Y) + + + + + + + + {isSupplyChangeLoading ? ( + + ) : supplyChangeData?.supplyChange != null ? ( + formatPercent(supplyChangeData.supplyChange, { + precision: 2, + }) + ) : ( + "--" + )} + + + + + + )} ) : (