Skip to content

Commit

Permalink
chore: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
carina-akaia committed Nov 27, 2024
1 parent 6451dd6 commit a4d4ef7
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/modules/project/components/ProjectDiscovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import { useProjectLookup } from "../hooks/lookup";
import { ProjectCategory, ProjectListingStatusVariant } from "../types";
import { ProjectCardSkeleton } from "./ProjectCardSkeleton";

const ProjectLookupPlaceholder = () =>
Array.from({ length: 6 }, (_, index) => <ProjectCardSkeleton key={index} />);

export const ProjectDiscovery = () => {
const {
projectCategoryFilter,
Expand Down Expand Up @@ -110,16 +113,16 @@ export const ProjectDiscovery = () => {
</div>

<div className="md:grid-cols-2 lg:grid-cols-3 mt-8 grid w-full grid-cols-1 gap-8">
{isProjectLookupPending
? Array.from({ length: 6 }, (_, index) => (
<ProjectCardSkeleton key={index} />
))
: projects.map((registration: ListRegistration) => (
<ProjectCard
projectId={registration.registrant.id}
key={registration.id}
/>
))}
{isProjectLookupPending ? (
<ProjectLookupPlaceholder />
) : (
projects.map((registration: ListRegistration) => (
<ProjectCard
projectId={registration.registrant.id}
key={registration.id}
/>
))
)}
</div>

{totalProjectCount ? (
Expand Down

0 comments on commit a4d4ef7

Please sign in to comment.