forked from Maakaf/maakaf-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maakaf#246 - Initial commit - Adding skeleton loading spinner in memb…
…ers page as described in Figma
- Loading branch information
Showing
8 changed files
with
84 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 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 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,28 @@ | ||
import { Skeleton } from '@/components/ui/skeleton'; | ||
|
||
const SkeletonCard = () => { | ||
return ( | ||
<Skeleton className="flex bg-purple-100 dark:bg-gray-600 rounded-2xl shadow-md w-full xl:w-[400px] xl:h-[173px]"> | ||
<div className="flex flex-col rounded-md p-[10px] pr-6 w-full"> | ||
<div className="flex gap-4"> | ||
<Skeleton className="w-[50px] h-[50px] rounded-full bg-purple-200 dark:bg-slate-100/50" /> | ||
<div className="titles-container"> | ||
<div className="flex items-center"> | ||
<Skeleton className="ml-4 h-4 w-20 bg-purple-200 dark:bg-slate-100/50" /> | ||
</div> | ||
<Skeleton className="mt-2 w-[150px] h-4 bg-purple-200 dark:bg-slate-100/50" /> | ||
</div> | ||
</div> | ||
<Skeleton className="w-10/12 md:w-[291px] h-[51px] mt-2 mb-1 bg-purple-200 dark:bg-slate-100/50" /> | ||
<Skeleton className="w-[100px] h-[15px] mt-2 bg-purple-200 dark:bg-slate-100/50" /> | ||
</div> | ||
<div className="flex flex-col items-center w-[67px] bg-purple-200 justify-evenly dark:bg-gray-800 rounded-tl-2xl rounded-bl-2xl shadow-2xl"> | ||
<Skeleton className="w-[30px] h-[30px] rounded-full bg-purple-100 dark:bg-slate-100/50" /> | ||
<Skeleton className="w-[30px] h-[30px] rounded-full bg-purple-100 dark:bg-slate-100/50" /> | ||
<Skeleton className="w-[30px] h-[30px] rounded-full bg-purple-100 dark:bg-slate-100/50" /> | ||
</div> | ||
</Skeleton> | ||
); | ||
}; | ||
|
||
export default SkeletonCard; |
This file contains 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,17 @@ | ||
import React from 'react'; | ||
import SkeletonCard from './SkeletonCard'; | ||
|
||
const SkeletonCards = ({ cards = 6 }: { cards?: number }) => { | ||
const cardsToRender = Array(cards) | ||
.fill(null) | ||
.map((_, i) => i); | ||
return ( | ||
<div className="flex mx-auto w-[90%] flex-wrap gap-4 mt-6 justify-between"> | ||
{cardsToRender.map(card => ( | ||
<SkeletonCard key={card} /> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default SkeletonCards; |
This file contains 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,18 @@ | ||
import { cn } from '@/lib/utils/tailwind/cn'; | ||
|
||
function Skeleton({ | ||
className, | ||
...props | ||
}: React.HTMLAttributes<HTMLDivElement>) { | ||
return ( | ||
<div | ||
className={cn( | ||
'animate-pulse rounded-md bg-purple-100 dark:bg-gray-600', | ||
className | ||
)} | ||
{...props} | ||
/> | ||
); | ||
} | ||
|
||
export { Skeleton }; |
This file contains 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 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 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