Skip to content

Commit

Permalink
feat: Add Epoch index to Slot page (#1469)
Browse files Browse the repository at this point in the history
Co-authored-by: Begoña Álvarez de la Cruz <[email protected]>
  • Loading branch information
brancoder and begonaalvarezd authored May 7, 2024
1 parent c74ba5f commit e3d196e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/src/app/routes/nova/SlotPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function SlotPage({
}>): React.JSX.Element {
const { manaInfo } = useNetworkInfoNova((s) => s.networkInfo);
const { latestSlotCommitments = [] } = useSlotsFeed();
const { slotIndexToUnixTimeRange } = useNovaTimeConvert();
const { slotIndexToUnixTimeRange, slotIndexToEpochIndex } = useNovaTimeConvert();
const { slotCommitment: slotCommitmentDetails, slotCommitmentId } = useSlotDetails(network, slotIndex);
const { slotManaBurned } = useSlotManaBurned(slotIndex);
const [slotStats] = useSlotStats(slotIndex);
Expand All @@ -42,6 +42,7 @@ export default function SlotPage({
const slotFromSlotCommitments = latestSlotCommitments.find((slot) => slot.slotCommitment.slot === parsedSlotIndex);
const slotTimeRange = parsedSlotIndex && slotIndexToUnixTimeRange ? slotIndexToUnixTimeRange(parsedSlotIndex) : null;
const slotTimestamp = getSlotTimestamp(slotTimeRange);
const epochIndex = parsedSlotIndex && slotIndexToEpochIndex ? slotIndexToEpochIndex(parsedSlotIndex) : null;

const rmc =
slotFromSlotCommitments?.slotCommitment?.referenceManaCost?.toString() ??
Expand All @@ -54,6 +55,10 @@ export default function SlotPage({
value: parsedSlotIndex ?? FALLBACK_STRING,
},
{ title: "Timestamp", value: slotTimestamp ?? FALLBACK_STRING },
{
title: "Epoch Index",
value: epochIndex ?? FALLBACK_STRING,
},
{
title: "RMC",
value: formatAmount(rmc, manaInfo, formatManaAmounts),
Expand Down

0 comments on commit e3d196e

Please sign in to comment.