Skip to content

Commit

Permalink
Merge pull request #946 from makerdao/show-v1-delegate-factory-in-stats
Browse files Browse the repository at this point in the history
show v1 and v2 delegate factory in stats
  • Loading branch information
tyler17 authored Oct 24, 2024
2 parents b05d9c6 + 090007d commit 2524270
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions modules/delegates/components/DelegatesSystemInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function DelegatesSystemInfo({
className?: string;
}): React.ReactElement {
const delegateFactoryAddress = useContractAddress('voteDelegateFactory');
const oldDelegateFactoryAddress = useContractAddress('voteDelegateFactoryOld');
const { network } = useWeb3();

const { data: totalMkr } = useTotalSupply(Tokens.MKR);
Expand Down Expand Up @@ -64,7 +65,7 @@ export function DelegatesSystemInfo({
)
},
{
title: 'Total Delegators',
title: 'Total delegators',
id: 'total-delegators-system-info',
value: stats.totalDelegators
}
Expand All @@ -78,7 +79,7 @@ export function DelegatesSystemInfo({
<Card variant="compact">
<StackLayout gap={3}>
<Flex sx={{ justifyContent: 'space-between', flexDirection: 'row' }}>
<Text sx={{ fontSize: 3, color: 'textSecondary' }}>Delegate Factory</Text>
<Text sx={{ fontSize: 3, color: 'textSecondary' }}>V2 delegate factory</Text>
{delegateFactoryAddress ? (
<EtherscanLink type="address" showAddress hash={delegateFactoryAddress} network={network} />
) : (
Expand All @@ -87,6 +88,16 @@ export function DelegatesSystemInfo({
</Box>
)}
</Flex>
<Flex sx={{ justifyContent: 'space-between', flexDirection: 'row' }}>
<Text sx={{ fontSize: 3, color: 'textSecondary' }}>V1 delegate factory</Text>
{oldDelegateFactoryAddress ? (
<EtherscanLink type="address" showAddress hash={oldDelegateFactoryAddress} network={network} />
) : (
<Box sx={{ width: 6 }}>
<SkeletonThemed />
</Box>
)}
</Flex>
{statsItems.map(item => (
<Flex key={item.id} sx={{ justifyContent: 'space-between', flexDirection: 'row' }}>
<Text sx={{ fontSize: 3, color: 'textSecondary' }}>{item.title}</Text>
Expand Down

0 comments on commit 2524270

Please sign in to comment.