Skip to content

Commit

Permalink
Merge pull request #81 from GeneralMagicio/mateodaza/hotfix-on-petitions
Browse files Browse the repository at this point in the history
Warning validation for banned validators
  • Loading branch information
mateodaza committed Jun 29, 2023
2 parents 8ee69b1 + 714adc4 commit 496d0fb
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/views/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ export function UserInfo() {
const claimableRewards = weiToEth(onChainProofQuery.data?.claimableRewardsWei)
const pendingRewards = weiToEth(onChainProofQuery.data?.pendingRewardsWei)

const setWarning = (status: string) => {
switch (status) {
case 'yellowcard':
return 'yellow'
case 'redcard':
return 'red'
case 'banned':
return 'banned'
default:
return 'none'
}
}

let tableData: Validator[] = []
if (validatorsQuery.data) {
tableData = validatorsQuery.data.map(
Expand All @@ -48,7 +61,7 @@ export function UserInfo() {
subscribed: status === 'active',
validatorId: validatorIndex,
validatorKey: validatorKey as `0x${string}`,
warning: 'none',
warning: setWarning(status),
})
)
}
Expand Down

1 comment on commit 496d0fb

@vercel
Copy link

@vercel vercel bot commented on 496d0fb Jun 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.