-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
9e785ac
commit 9a542bf
Showing
16 changed files
with
275 additions
and
77 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
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
21 changes: 13 additions & 8 deletions
21
src/app/collective-rewards/metrics/TotalActiveBuildersMetrics.tsx
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,17 +1,22 @@ | ||
import { MetricsCardWithSpinner } from '@/components/MetricsCard/MetricsCard' | ||
import { useGetGaugesLength } from '../user' | ||
import { useGetGaugesLength } from '@/app/collective-rewards/user' | ||
import { MetricsCard, MetricsCardTitle, TokenMetricsCardRow } from '@/app/collective-rewards/rewards' | ||
import { withSpinner } from '@/components/LoadingSpinner/withLoadingSpinner' | ||
import { useHandleErrors } from '@/app/collective-rewards/utils' | ||
|
||
export const TotalActiveBuildersMetrics = () => { | ||
const { data, isLoading, error } = useGetGaugesLength('active') | ||
useHandleErrors({ error, title: 'Error loading active builders' }) | ||
|
||
return ( | ||
<MetricsCardWithSpinner | ||
title="Total active builders" | ||
amount={Number(data || 0n).toFixed()} | ||
isLoading={isLoading} | ||
borderless | ||
/> | ||
<MetricsCard borderless> | ||
<MetricsCardTitle title="Total active builders" data-testid="TotalActiveBuilders" /> | ||
{withSpinner( | ||
TokenMetricsCardRow, | ||
'min-h-0 grow-0', | ||
)({ | ||
amount: Number(data || 0n).toFixed(), | ||
isLoading, | ||
})} | ||
</MetricsCard> | ||
) | ||
} |
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
22 changes: 14 additions & 8 deletions
22
src/app/collective-rewards/metrics/hooks/useGetCycleNext.ts
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
22 changes: 14 additions & 8 deletions
22
src/app/collective-rewards/metrics/hooks/useGetCycleStart.ts
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
22 changes: 14 additions & 8 deletions
22
src/app/collective-rewards/metrics/hooks/useGetEndDistributionWindow.ts
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.