From 989f7ad5c16df4151d1e42b864cfdb73f7e96572 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Thu, 12 Sep 2024 19:09:04 +0100 Subject: [PATCH] Add streaks for lifetime --- src/api/leaderboard.ts | 5 ++++- src/components/Leaderboard/LeaderboardPage.tsx | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/api/leaderboard.ts b/src/api/leaderboard.ts index 9048cb876..09d4c0bc6 100644 --- a/src/api/leaderboard.ts +++ b/src/api/leaderboard.ts @@ -9,7 +9,10 @@ export type LeadeboardUserDetails = { }; export type ListLeaderboardStatsResponse = { - longestStreaks: LeadeboardUserDetails[]; + streaks: { + active: LeadeboardUserDetails[]; + lifetime: LeadeboardUserDetails[]; + }; projectSubmissions: { currentMonth: LeadeboardUserDetails[]; lifetime: LeadeboardUserDetails[]; diff --git a/src/components/Leaderboard/LeaderboardPage.tsx b/src/components/Leaderboard/LeaderboardPage.tsx index ad529e525..9c7e6e1d5 100644 --- a/src/components/Leaderboard/LeaderboardPage.tsx +++ b/src/components/Leaderboard/LeaderboardPage.tsx @@ -34,8 +34,14 @@ export function LeaderboardPage(props: LeaderboardPageProps) { title="Longest Visit Streak" tabs={[ { - title: 'All Time', - users: stats.longestStreaks, + title: 'Active', + users: stats.streaks?.active || [], + emptyIcon: , + emptyText: 'No users with streaks yet', + }, + { + title: 'Lifetime', + users: stats.streaks?.lifetime || [], emptyIcon: , emptyText: 'No users with streaks yet', },