Skip to content

Commit

Permalink
Add loading screen
Browse files Browse the repository at this point in the history
  • Loading branch information
ozdentarikcan committed Dec 16, 2024
1 parent db045ce commit b803c0f
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions frontend/src/components/TagType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,6 @@ export default function SubtypePage() {

return (
<div className="container py-8">
{isLoading ? (
<div className="flex items-center justify-center">
<Loader2
aria-label="Loading"
className="h-16 w-16 animate-spin text-primary"
/>
</div>
) : (
<>
{/* Header */}
<h1 className="mb-4 text-4xl font-bold text-gray-800">{tagTypeId}</h1>

Expand All @@ -165,17 +156,18 @@ export default function SubtypePage() {
}
isLoading={isLoading}
>
{tags.length > 0 ? (
tags.map((tag) => <TagCard key={tag.tagId} tag={tag} />)
) : (
<p className="col-span-3 text-center text-gray-600">
No related tags found for this tag type.
</p>
)}
{tags?.map((tag) => <TagCard key={tag.tagId} tag={tag} />)
}
</InfiniteScroll>
{isLoading && (
<div className="col-span-3 flex w-full items-center justify-center">
<Loader2
aria-label="Loading"
className="h-16 w-16 animate-spin text-primary"
/>
</div>
)}
</div>
</>
)}
</div>
);
}

0 comments on commit b803c0f

Please sign in to comment.