-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #654 from dappforce/deploy/leaderboard
Add leaderboard page
- Loading branch information
Showing
31 changed files
with
1,959 additions
and
56 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
52 changes: 52 additions & 0 deletions
52
src/components/leaderboard/GlobalStats/GlobalStatsDashboard.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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { getGeneralStatisticsQuery } from '@/services/datahub/leaderboard/query' | ||
import { UserStatsCard } from '../MyStats/LeaderboardStatsData' | ||
|
||
const GlobalStatsDashboard = () => { | ||
const { data: generalStats, isLoading } = getGeneralStatisticsQuery.useQuery( | ||
{} | ||
) | ||
|
||
const { stakersEarnedTotal, creatorsEarnedTotal, creatorsLiked, postsLiked } = | ||
generalStats || {} | ||
|
||
const data = [ | ||
{ | ||
title: 'Total posts and comments liked', | ||
value: postsLiked, | ||
tooltipText: | ||
'The total number of individual posts or comments that were liked at least one time this week', | ||
rank: null, | ||
}, | ||
{ | ||
title: 'Total SUB earned by stakers', | ||
value: stakersEarnedTotal, | ||
tooltipText: | ||
'The total amount of SUB rewards earned by stakers on Subsocial this week', | ||
rank: null, | ||
}, | ||
{ | ||
title: 'Total creators liked', | ||
value: creatorsLiked, | ||
tooltipText: | ||
'The total number of individual creators that had one of their posts or comments liked this week', | ||
rank: null, | ||
}, | ||
{ | ||
title: 'Total SUB earned by creators', | ||
value: creatorsEarnedTotal, | ||
tooltipText: | ||
'The total amount of SUB rewards earned by creators on Subsocial this week', | ||
rank: null, | ||
}, | ||
] | ||
|
||
return ( | ||
<> | ||
{data.map((item, index) => ( | ||
<UserStatsCard key={index} {...item} isLoading={isLoading} /> | ||
))} | ||
</> | ||
) | ||
} | ||
|
||
export default GlobalStatsDashboard |
Oops, something went wrong.