-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validator management page #425
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -457,6 +461,14 @@ body::-webkit-scrollbar { | |||
background: rgb(244 139 54 / 13%); | |||
} | |||
|
|||
.btnprimary { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flagged for Consistency: .btnprimary -> .btnPrimary
@@ -76,6 +76,10 @@ body { | |||
width: 100%; | |||
} | |||
|
|||
.fullH { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency: .fullH -> .fullHeight
.btnDisabled { | ||
background: #262626; | ||
} | ||
|
||
.btnSmLoading { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistentcy: .btnSmallLoading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General note on useState setup in React.
You have mix and matched null and undefined.
Believe that the standard tends to lean toward undefined as the "best practice" but in this case just consistency flag that it might be good to have them all the same
@@ -43,7 +43,7 @@ export default function ErrorTile(props: { | |||
icon={<ErrorRoundedIcon />} | |||
color="error" | |||
grow | |||
children={ | |||
childrenRi={ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs more explicit naming I think.
Since children can be "passed through" e.g <>{children}</> the Ri flag on first look seems like a typo
const description = props.validator.description ? props.validator.description : 'No description' | ||
const minDelegation = fromWei(props.validator.minimumDelegationAmount, DEFAULT_ERC20_DECIMALS) | ||
export default function ValidatorInfo(props: { | ||
validator: types.staking.IValidator | null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined over null?
sc: types.staking.ISkaleContractsMap | null | ||
address: types.AddressType | undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined or null
}: { | ||
delegationType: types.staking.DelegationType | ||
txName: string | ||
txArgs: any[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid any if possible
|
||
const [currentValidator, setCurrentValidator] = useState<IValidator | undefined>(undefined) | ||
const [currentValidator, setCurrentValidator] = useState<types.staking.IValidator | undefined>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined types initial state being empty defaults to undefined
address: types.AddressType | undefined | ||
customAddress: types.AddressType | undefined | ||
loadValidator: () => Promise<void> | ||
validator: types.staking.IValidator | null | undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null and undefined should not be possible
In this PR: