-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
159 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { CustomRow, CustomRowBasic } from "./prepareValidatorRow.ts"; | ||
|
||
// TODO probably we should change CommitmentStatus to Enum and compare as if(elt.commitment in CommitmentStatus) to find extended statuses | ||
export function isReal( | ||
slot: CustomRow["slots"][number] | CustomRowBasic["slots"][number] | ||
): slot is CustomRowBasic["slots"][number] { | ||
return slot.commitment !== "next-leader" && slot.commitment !== "scheduled"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
import { Text } from "@consta/uikit/Text"; | ||
import { CustomRow } from "../../common/prepareValidatorRow.ts"; | ||
import { isReal } from "../../common/isReal.ts"; | ||
|
||
interface Props { | ||
list: number[]; | ||
items: number[]; | ||
slots: CustomRow["slots"]; | ||
} | ||
export const SimpleCell = ({ list }: Props) => { | ||
export const SimpleCell = ({ items, slots }: Props) => { | ||
return ( | ||
<div className="px-3 text-right"> | ||
{list.map((elt, idx) => ( | ||
<Text key={idx} font="mono"> | ||
{elt.toLocaleString("en-US", { maximumFractionDigits: 2 })} | ||
</Text> | ||
))} | ||
{items.map((elt, idx) => { | ||
const currentSlot = slots[idx]; | ||
const isFilled = currentSlot ? isReal(currentSlot) : false; | ||
|
||
return ( | ||
<Text key={idx} font="mono" className="whitespace-pre"> | ||
{isFilled ? elt.toLocaleString("en-US", { maximumFractionDigits: 2 }) : " "} | ||
</Text> | ||
); | ||
})} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.