From 94231874b0003b9af0f50fa074469dbf8d1c987d Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Tue, 11 Feb 2025 01:52:08 +0000 Subject: [PATCH] Empty screen handling --- .../Dashboard/PersonalDashboard.tsx | 5 +- .../HeroSection/FavoriteRoadmaps.tsx | 69 ++++++++++++++++++- src/components/HeroSection/HeroItemsGroup.tsx | 16 +++-- src/components/HeroSection/HeroTitle.tsx | 8 ++- 4 files changed, 88 insertions(+), 10 deletions(-) diff --git a/src/components/Dashboard/PersonalDashboard.tsx b/src/components/Dashboard/PersonalDashboard.tsx index fb4c65b44..7bba9a0b0 100644 --- a/src/components/Dashboard/PersonalDashboard.tsx +++ b/src/components/Dashboard/PersonalDashboard.tsx @@ -299,7 +299,10 @@ export function PersonalDashboard(props: PersonalDashboardProps) {
-

+

Role Based Roadmaps

diff --git a/src/components/HeroSection/FavoriteRoadmaps.tsx b/src/components/HeroSection/FavoriteRoadmaps.tsx index 91563ef79..785338e1b 100644 --- a/src/components/HeroSection/FavoriteRoadmaps.tsx +++ b/src/components/HeroSection/FavoriteRoadmaps.tsx @@ -5,6 +5,8 @@ import { Sparkle, Eye, EyeOff, + Square, + SquareCheckBig, } from 'lucide-react'; import { useState } from 'react'; import type { ProjectStatusDocument } from '../Projects/ListProjectSolutions.tsx'; @@ -14,6 +16,7 @@ import { HeroProject } from './HeroProject'; import { HeroRoadmap } from './HeroRoadmap'; import { CreateRoadmapButton } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapButton.tsx'; import { HeroItemsGroup } from './HeroItemsGroup'; +import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal.tsx'; export type AIRoadmapType = { id: string; @@ -34,6 +37,7 @@ type FavoriteRoadmapsProps = { export function FavoriteRoadmaps(props: FavoriteRoadmapsProps) { const { progress, isLoading, customRoadmaps, aiRoadmaps, projects } = props; const [showCompleted, setShowCompleted] = useState(false); + const [isCreatingCustomRoadmap, setIsCreatingCustomRoadmap] = useState(false); const completedProjects = projects.filter( (project) => project.submittedAt && project.repositoryUrl, @@ -49,10 +53,31 @@ export function FavoriteRoadmaps(props: FavoriteRoadmapsProps) { return (
+ {isCreatingCustomRoadmap && ( + { + setIsCreatingCustomRoadmap(false); + }} + /> + )} + } isLoading={isLoading} title="Your progress and bookmarks" + isEmpty={progress.length === 0} + emptyTitle={ + <> + No bookmarked roadmaps yet + + + Bookmark a roadmap + + + } > {progress.map((resource) => ( ))} - } isLoading={isLoading} title="Your custom roadmaps" + isEmpty={customRoadmaps.length === 0} + emptyTitle={ + <> + No custom roadmaps found + + + } > {customRoadmaps.map((customRoadmap) => ( } isLoading={isLoading} title="Your AI roadmaps" + isEmpty={aiRoadmaps.length === 0} + emptyTitle={ + <> + No AI roadmaps found + + + } > {aiRoadmaps.map((aiRoadmap) => ( } isLoading={isLoading} title="Your active projects" + isEmpty={projectsToShow.length === 0} + emptyTitle={ + <> + No active projects found + + + Start a new project + + + } rightContent={ completedProjects.length > 0 && (
{!isCollapsed && rightContent} - {!isLoading && ( + {!isLoading && !isEmpty && (