Skip to content

Commit

Permalink
Added skeleton loader to PeriodCard
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-ao committed Jul 21, 2024
1 parent f8ec442 commit 04dfb48
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/PeriodCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@ const PeriodCard = ({ period }: Props) => {
router.push(`/application/${period._id}`);
};

if (isLoading) return <p>Vent litt...</p>;
if (isLoading) {
return (
<div className="w-full max-w-md p-4 border border-gray-200 rounded shadow animate-pulse md:p-6 dark:border-gray-700 ">
<div className="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-48 mb-4"></div>
<div className="h-2 bg-gray-200 rounded-full dark:bg-gray-700 mb-2.5"></div>
<div className="h-2 bg-gray-200 rounded-full dark:bg-gray-700 mb-2.5"></div>
<div className="h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
</div>
);
}

return (
<div className="relative w-full max-w-md mx-auto break-words border rounded-lg shadow dark:bg-gray-800 dark:border-gray-700 dark:text-white">
Expand Down

0 comments on commit 04dfb48

Please sign in to comment.