Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Frontend] Add loading screen to TagType Page #697

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
}
Loading