feat: add topics done today count

feat/dashboard
Arik Chakma 3 months ago
parent 445bb3ad2a
commit 2ec69636c2
  1. 2
      src/components/Dashboard/PersonalDashboard.tsx
  2. 9
      src/components/Dashboard/ProgressStack.tsx

@ -19,6 +19,7 @@ type UserDashboardResponse = {
username: string;
progresses: UserProgress[];
projects: ProjectStatusDocument[];
topicDoneToday: number;
};
export type BuiltInRoadmap = {
@ -276,6 +277,7 @@ export function PersonalDashboard(props: PersonalDashboardProps) {
projects={enrichedProjects || []}
isLoading={isLoading}
accountStreak={accountStreak}
topicDoneToday={personalDashboardDetails?.topicDoneToday || 0}
/>
<ListDashboardCustomProgress

@ -16,6 +16,7 @@ type ProgressStackProps = {
})[];
accountStreak?: StreakResponse;
isLoading: boolean;
topicDoneToday: number;
};
const MAX_PROGRESS_TO_SHOW = 5;
@ -23,7 +24,8 @@ const MAX_PROJECTS_TO_SHOW = 8;
const MAX_BOOKMARKS_TO_SHOW = 8;
export function ProgressStack(props: ProgressStackProps) {
const { progresses, projects, isLoading, accountStreak } = props;
const { progresses, projects, isLoading, accountStreak, topicDoneToday } =
props;
const bookmarkedProgresses = progresses.filter(
(progress) =>
@ -62,6 +64,11 @@ export function ProgressStack(props: ProgressStackProps) {
value={accountStreak?.count || 0}
isLoading={isLoading}
/>
<StatsCard
title="Topics Done Today"
value={topicDoneToday}
isLoading={isLoading}
/>
<StatsCard
title="Projects Finished"
value={totalProjectFinished}

Loading…
Cancel
Save