-
-
Notifications
You must be signed in to change notification settings - Fork 313
Add skeleton loading states for About, Organization, and Snapshot pages #2757
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
Open
dhirukumar
wants to merge
9
commits into
OWASP:main
Choose a base branch
from
dhirukumar:feature/skeleton-loading
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+266
−43
Open
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f81dbd6
Changed light mode icon because it was misleading
dhirukumar 061fd64
base change
dhirukumar 4cfd5c2
Implemented skeleton loading states for About, Organization, and Snap…
dhirukumar 0a24171
Update ModeToggle.tsx
dhirukumar 7accec0
Fix SonarCloud issues: nested ternaries, array keys, and accessibility
dhirukumar 2b9e737
Merge branch 'feature/skeleton-loading' of https://github.com/dhiruku…
dhirukumar 5a75871
fix Minor issue in about page.tsx
dhirukumar 8db0854
resolve coderabbit issue and run all checks
dhirukumar ac84948
Fix SonarCloud issue
dhirukumar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| import { Skeleton } from '@heroui/skeleton' | ||
|
|
||
| const AboutSkeleton = () => { | ||
| return ( | ||
| <div className="min-h-screen p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300"> | ||
| <div className="mx-auto max-w-6xl"> | ||
| {/* Title Skeleton */} | ||
| <Skeleton className="mt-4 mb-6 h-10 w-32" /> | ||
|
|
||
| {/* Our Mission and Who It's For Grid */} | ||
| <div className="grid gap-0 md:grid-cols-2 md:gap-6"> | ||
| <div className="mb-6 rounded-lg bg-gray-100 p-6 dark:bg-gray-800"> | ||
| <Skeleton className="mb-4 h-6 w-40" /> | ||
| <Skeleton className="mb-2 h-4 w-full" /> | ||
| <Skeleton className="mb-2 h-4 w-full" /> | ||
| <Skeleton className="h-4 w-3/4" /> | ||
| </div> | ||
| <div className="mb-6 rounded-lg bg-gray-100 p-6 dark:bg-gray-800"> | ||
| <Skeleton className="mb-4 h-6 w-40" /> | ||
| <Skeleton className="mb-2 h-4 w-full" /> | ||
| <Skeleton className="mb-2 h-4 w-full" /> | ||
| <Skeleton className="h-4 w-3/4" /> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Key Features Section */} | ||
| <div className="mb-6 rounded-lg bg-gray-100 p-6 dark:bg-gray-800"> | ||
| <Skeleton className="mb-4 h-6 w-40" /> | ||
| <div className="grid gap-4 md:grid-cols-2"> | ||
| {[1, 2, 3, 4].map((i) => ( | ||
| <div key={i} className="rounded-lg bg-gray-200 p-4 dark:bg-gray-700"> | ||
| <Skeleton className="mb-2 h-5 w-3/4" /> | ||
| <Skeleton className="mb-2 h-4 w-full" /> | ||
| <Skeleton className="h-4 w-full" /> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Leaders Section */} | ||
| <div className="mb-6 rounded-lg bg-gray-100 p-6 dark:bg-gray-800"> | ||
| <Skeleton className="mb-4 h-6 w-32" /> | ||
| <div className="grid gap-4 md:grid-cols-3"> | ||
| {[1, 2, 3].map((i) => ( | ||
| <div key={i} className="flex flex-col items-center"> | ||
| <Skeleton className="mb-3 h-24 w-24 rounded-full" /> | ||
| <Skeleton className="mb-2 h-5 w-32" /> | ||
| <Skeleton className="h-4 w-24" /> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Top Contributors Section */} | ||
| <div className="mb-6 rounded-lg bg-gray-100 p-6 dark:bg-gray-800"> | ||
| <Skeleton className="mb-4 h-6 w-48" /> | ||
| <div className="grid gap-4 md:grid-cols-3 lg:grid-cols-4"> | ||
| {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((i) => ( | ||
| <div key={i} className="flex flex-col items-center"> | ||
| <Skeleton className="mb-2 h-16 w-16 rounded-full" /> | ||
| <Skeleton className="mb-1 h-4 w-24" /> | ||
| <Skeleton className="h-3 w-16" /> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Technologies Section */} | ||
| <div className="mb-6 rounded-lg bg-gray-100 p-6 dark:bg-gray-800"> | ||
| <Skeleton className="mb-4 h-6 w-52" /> | ||
| <div className="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4"> | ||
| {[1, 2, 3, 4].map((i) => ( | ||
| <div key={i}> | ||
| <Skeleton className="mb-3 h-5 w-32" /> | ||
| <div className="flex flex-col gap-3"> | ||
| {[1, 2, 3, 4].map((j) => ( | ||
| <div key={j} className="flex items-center gap-2"> | ||
| <Skeleton className="h-6 w-6 rounded" /> | ||
| <Skeleton className="h-4 w-24" /> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Get Involved Section */} | ||
| <div className="mb-6 rounded-lg bg-gray-100 p-6 dark:bg-gray-800"> | ||
| <Skeleton className="mb-4 h-6 w-40" /> | ||
| <Skeleton className="mb-2 h-4 w-full" /> | ||
| <div className="mb-6 space-y-2"> | ||
| {[1, 2, 3, 4].map((i) => ( | ||
| <Skeleton key={i} className="h-4 w-full" /> | ||
| ))} | ||
| </div> | ||
| <Skeleton className="h-4 w-2/3" /> | ||
| </div> | ||
|
|
||
| {/* Roadmap Section */} | ||
| <div className="mb-6 rounded-lg bg-gray-100 p-6 dark:bg-gray-800"> | ||
| <Skeleton className="mb-4 h-6 w-32" /> | ||
| <div className="space-y-4"> | ||
| {[1, 2, 3].map((i) => ( | ||
| <div key={i} className="rounded-lg bg-gray-200 p-6 dark:bg-gray-700"> | ||
| <Skeleton className="mb-2 h-6 w-2/3" /> | ||
| <Skeleton className="mb-2 h-4 w-full" /> | ||
| <Skeleton className="h-4 w-full" /> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Our Story Section */} | ||
| <div className="mb-6 rounded-lg bg-gray-100 p-6 dark:bg-gray-800"> | ||
| <Skeleton className="mb-4 h-6 w-32" /> | ||
| {[1, 2, 3].map((i) => ( | ||
| <div key={i} className="mb-4"> | ||
| <Skeleton className="mb-2 h-4 w-full" /> | ||
| <Skeleton className="mb-2 h-4 w-full" /> | ||
| <Skeleton className="h-4 w-3/4" /> | ||
| </div> | ||
| ))} | ||
| </div> | ||
|
|
||
| {/* Project Timeline Section */} | ||
| <div className="mb-6 rounded-lg bg-gray-100 p-6 dark:bg-gray-800"> | ||
| <Skeleton className="mb-4 h-6 w-48" /> | ||
| <div className="space-y-6"> | ||
| {[1, 2, 3, 4].map((i) => ( | ||
| <div key={i} className="relative pl-10"> | ||
| <Skeleton className="absolute top-[10px] left-0 h-3 w-3 rounded-full" /> | ||
| <Skeleton className="mb-1 h-5 w-48" /> | ||
| <Skeleton className="mb-2 h-4 w-24" /> | ||
| <Skeleton className="mb-1 h-4 w-full" /> | ||
| <Skeleton className="h-4 w-2/3" /> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Stats Grid */} | ||
| <div className="grid gap-0 md:grid-cols-4 md:gap-6"> | ||
| {[1, 2, 3, 4].map((i) => ( | ||
| <div key={i} className="mb-6 rounded-lg bg-gray-100 p-6 text-center dark:bg-gray-800"> | ||
| <Skeleton className="mx-auto mb-2 h-8 w-20" /> | ||
| <Skeleton className="mx-auto h-4 w-24" /> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default AboutSkeleton |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { Skeleton } from '@heroui/skeleton' | ||
| import type React from 'react' | ||
|
|
||
| interface SnapshotSkeletonProps { | ||
| showTitle?: boolean | ||
| showDateRange?: boolean | ||
| showViewButton?: boolean | ||
| } | ||
|
|
||
| const SnapshotSkeleton: React.FC<SnapshotSkeletonProps> = ({ | ||
| showTitle = true, | ||
| showDateRange = true, | ||
| showViewButton = true, | ||
| }) => { | ||
| return ( | ||
| <div | ||
| role="status" | ||
| className="group flex h-40 w-full flex-col items-center rounded-lg bg-white p-6 text-left shadow-lg dark:bg-gray-800 dark:shadow-gray-900/30" | ||
| > | ||
|
Check warning on line 19 in frontend/src/components/skeletons/SnapshotSkeleton.tsx
|
||
| <div className="text-center">{showTitle && <Skeleton className="h-7 w-56 rounded-md" />}</div> | ||
|
|
||
| {showDateRange && ( | ||
| <div className="mt-2 flex items-center gap-2"> | ||
| <Skeleton className="h-4 w-4 rounded" /> | ||
| <Skeleton className="h-5 w-48 rounded-md" /> | ||
| </div> | ||
| )} | ||
|
|
||
| {showViewButton && ( | ||
| <div className="mt-auto flex items-center gap-2"> | ||
| <Skeleton className="h-5 w-28 rounded-md" /> | ||
| <Skeleton className="h-4 w-4 rounded" /> | ||
| </div> | ||
| )} | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default SnapshotSkeleton | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The skeleton state is narrower than the final page layout, which causes a visible jump on reload.
Could you update this to match the Snapshot page layout?
Snapshots-.-OWASP-Nest.mp4