diff --git a/src/components/Dashboard/PersonalDashboard.tsx b/src/components/Dashboard/PersonalDashboard.tsx index 7bba9a0b0..34b9b7088 100644 --- a/src/components/Dashboard/PersonalDashboard.tsx +++ b/src/components/Dashboard/PersonalDashboard.tsx @@ -1,9 +1,11 @@ import { useStore } from '@nanostores/react'; import { + ChartColumn, CheckCircle, - ChevronsDownUp, - ChevronsUpDown, + CheckSquare, FolderGit2, + Pencil, + SquarePen, Zap, type LucideIcon, } from 'lucide-react'; @@ -19,9 +21,9 @@ import { FavoriteRoadmaps, type AIRoadmapType, } from '../HeroSection/FavoriteRoadmaps.tsx'; +import { HeroRoadmap } from '../HeroSection/HeroRoadmap.tsx'; import type { ProjectStatusDocument } from '../Projects/ListProjectSolutions'; import type { UserProgress } from '../TeamProgress/TeamProgressPage'; -import { HeroRoadmap } from '../HeroSection/HeroRoadmap.tsx'; type UserDashboardResponse = { name: string; @@ -54,13 +56,6 @@ type PersonalDashboardProps = { builtInBestPractices?: BuiltInRoadmap[]; }; -type DashboardStatsProps = { - accountStreak?: StreakResponse; - topicsDoneToday?: number; - finishedProjectsCount?: number; - isLoading: boolean; -}; - type DashboardStatItemProps = { icon: LucideIcon; iconClassName: string; @@ -93,38 +88,108 @@ function DashboardStatItem(props: DashboardStatItemProps) { ); } +type ProfileButtonProps = { + isLoading: boolean; + name?: string; + username?: string; + avatar?: string; +}; + +function PersonalProfileButton(props: ProfileButtonProps) { + const { isLoading, name, username, avatar } = props; + + if (isLoading || !username) { + return ( + + + Set up your profile + + ); + } + + return ( +
+ + {name + Visit Profile + + + + +
+ ); +} + +type DashboardStatsProps = { + profile: ProfileButtonProps; + accountStreak?: StreakResponse; + topicsDoneToday?: number; + finishedProjectsCount?: number; + isLoading: boolean; +}; + function DashboardStats(props: DashboardStatsProps) { const { accountStreak, topicsDoneToday = 0, finishedProjectsCount = 0, isLoading, + profile, } = props; return (
-
- + - - {/* */} +
+ + + +
); @@ -280,6 +345,12 @@ export function PersonalDashboard(props: PersonalDashboardProps) { return (