11import { FC } from 'react'
22import { useTranslation } from 'react-i18next'
3- import Typography from '@mui/material/Typography '
3+ import { Typography } from '@oasisprotocol/ui-library/src/components/typography '
44import { Validator , ValidatorAggStats } from '../../../oasis-nexus/api'
55import { SnapshotTextCard } from '../../components/Snapshots/SnapshotCard'
6- import { COLORS } from 'styles/theme/colors'
7- import { VerticalProgressBar } from 'app/components/ProgressBar'
6+ import { CustomProgress } from 'app/components/ProgressBar'
87import { PercentageValue } from '../../components/PercentageValue'
98
109type VotingPowerCardProps = {
@@ -20,31 +19,33 @@ export const VotingPowerCard: FC<VotingPowerCardProps> = ({ validator, stats })
2019 title = { t ( 'validator.votingPower' ) }
2120 label = {
2221 typeof validator ?. voting_power === 'number' && (
23- < Typography sx = { { fontSize : 18 , color : COLORS . grayMedium } } >
24- ({ validator ?. voting_power . toLocaleString ( ) } )
25- </ Typography >
22+ < Typography > ({ validator ?. voting_power . toLocaleString ( ) } )</ Typography >
2623 )
2724 }
2825 withContentPadding = { false }
2926 >
3027 { typeof validator ?. voting_power === 'number' && stats ?. total_voting_power && (
31- < div className = "flex justify-between" >
32- < div className = "flex flex-col" >
33- < Typography sx = { { fontSize : 12 , color : COLORS . grayMedium , textAlign : 'left' , paddingBottom : 3 } } >
34- { t ( 'validator.votingPowerOverall' ) }
35- </ Typography >
36- < PercentageValue value = { validator . voting_power } total = { stats . total_voting_power } />
37- </ div >
28+ < >
29+ < Typography className = "font-normal text-xs text-muted-foreground text-left pb-2" >
30+ { t ( 'validator.votingPowerOverall' ) }
31+ </ Typography >
3832 < div className = "pt-4" >
39- < VerticalProgressBar
40- height = { 80 }
41- width = { 50 }
42- value = { ( 100 * validator . voting_power ) / stats . total_voting_power }
43- barWithBorder = { false }
44- barBackgroundColor = { COLORS . grayMediumLight }
33+ < CustomProgress
34+ value = { validator . voting_power }
35+ max = { stats . total_voting_power }
36+ label = {
37+ < span className = "font-bold" >
38+ < PercentageValue
39+ adaptMaximumFractionDigits
40+ value = { validator . voting_power }
41+ total = { stats . total_voting_power }
42+ maximumFractionDigits = { 2 }
43+ />
44+ </ span >
45+ }
4546 />
4647 </ div >
47- </ div >
48+ </ >
4849 ) }
4950 </ SnapshotTextCard >
5051 )
0 commit comments