Update UI for projects

pull/7093/head
Kamran Ahmed 2 months ago
parent e3b6bacbc4
commit 44a7a01e3c
  1. 2
      src/components/Dashboard/PersonalDashboard.tsx
  2. 2
      src/components/Dashboard/ProgressStack.tsx
  3. 2
      src/components/FeatureAnnouncement.tsx
  4. 2
      src/components/NavigationDropdown.tsx
  5. 32
      src/components/Projects/ProjectsPage.tsx

@ -258,7 +258,7 @@ export function PersonalDashboard(props: PersonalDashboardProps) {
icon={ConstructionEmoji} icon={ConstructionEmoji}
title="Build Projects" title="Build Projects"
description="Practice what you learn" description="Practice what you learn"
href="/backend/projects" href="/projects"
/> />
<DashboardCard <DashboardCard
icon={CheckEmoji} icon={CheckEmoji}

@ -208,7 +208,7 @@ export function ProgressStack(props: ProgressStackProps) {
emptyMessage={'No projects started'} emptyMessage={'No projects started'}
emptyIcon={FolderKanban} emptyIcon={FolderKanban}
emptyLinkText={'Explore Projects'} emptyLinkText={'Explore Projects'}
emptyLinkHref={'/backend/projects'} emptyLinkHref={'/projects'}
> >
{projectsToShow.map((project) => { {projectsToShow.map((project) => {
return ( return (

@ -23,7 +23,7 @@ export function FeatureAnnouncement(props: FeatureAnnouncementProps) {
</span> </span>
Projects are live on the{' '} Projects are live on the{' '}
<a <a
href={'/backend/projects'} href={'/projects'}
className="font-medium text-blue-500 underline underline-offset-2" className="font-medium text-blue-500 underline underline-offset-2"
> >
backend roadmap backend roadmap

@ -25,7 +25,7 @@ const links = [
Icon: Waypoints, Icon: Waypoints,
}, },
{ {
link: '/backend/projects', link: '/projects',
label: 'Projects', label: 'Projects',
description: 'Skill-up with real-world projects', description: 'Skill-up with real-world projects',
Icon: FolderKanban, Icon: FolderKanban,

@ -1,6 +1,6 @@
import { useEffect, useMemo, useRef, useState } from 'react'; import { useEffect, useMemo, useRef, useState } from 'react';
import { cn } from '../../lib/classname.ts'; import { cn } from '../../lib/classname.ts';
import { Filter, X } from 'lucide-react'; import {Box, Filter, Group, X} from 'lucide-react';
import { import {
deleteUrlParam, deleteUrlParam,
getUrlParams, getUrlParams,
@ -13,12 +13,14 @@ import {
} from '../../lib/project.ts'; } from '../../lib/project.ts';
import { ProjectCard } from './ProjectCard.tsx'; import { ProjectCard } from './ProjectCard.tsx';
type ProjectGroup = {
id: string;
title: string;
projects: ProjectFileType[];
};
type ProjectsPageProps = { type ProjectsPageProps = {
roadmapsProjects: { roadmapsProjects: ProjectGroup[];
id: string;
title: string;
projects: ProjectFileType[];
}[];
userCounts: Record<string, number>; userCounts: Record<string, number>;
}; };
@ -75,6 +77,10 @@ export function ProjectsPage(props: ProjectsPageProps) {
[visibleProjects], [visibleProjects],
); );
const activeGroupDetail = roadmapsProjects.find(
(group) => group.id === activeGroup,
);
return ( return (
<div className="border-t bg-gray-100"> <div className="border-t bg-gray-100">
<button <button
@ -133,7 +139,19 @@ export function ProjectsPage(props: ProjectsPageProps) {
</div> </div>
</div> </div>
</div> </div>
<div className="flex flex-grow flex-col gap-6 pb-20 pt-2 sm:pt-6"> <div className="flex flex-grow flex-col pb-20 pt-2 sm:pt-6">
<div className="mb-4 flex items-center justify-between text-sm text-gray-500">
<h3 className={'flex items-center'}>
<Box size={15} className="mr-1" strokeWidth={2} />
{activeGroupDetail
? `Projects in ${activeGroupDetail?.title}`
: 'All Projects'}
</h3>
<p className="text-left">
Matches found ({sortedVisibleProjects.length})
</p>
</div>
<div className="grid grid-cols-1 gap-1.5 sm:grid-cols-2"> <div className="grid grid-cols-1 gap-1.5 sm:grid-cols-2">
{sortedVisibleProjects.map((project) => ( {sortedVisibleProjects.map((project) => (
<ProjectCard <ProjectCard

Loading…
Cancel
Save