Skip to content

Commit f08afd4

Browse files
authored
fix(#595):Improve the dark mode skeleton to match dark design (#598)
1 parent cc142ef commit f08afd4

File tree

2 files changed

+46
-14
lines changed

2 files changed

+46
-14
lines changed

src/Skeletons/InvitationCardSkeleton.tsx

+27-6
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,38 @@ import 'react-loading-skeleton/dist/skeleton.css';
44

55
function InvitationCardSkeleton() {
66
return (
7-
<div className="bg-white rounded-md shadow-sm p-4 w-[100%] md:w-[30%]">
8-
<div className="flex flex-row items-center gap-4 mb-3">
9-
<Skeleton circle width={50} height={50} />
7+
<div className='bg-white dark:bg-[#0A1729] rounded-md shadow-sm p-4 w-[100%] md:w-[30%]'>
8+
<div className='flex flex-row items-center gap-4 mb-3'>
9+
<Skeleton
10+
circle
11+
width={50}
12+
height={50}
13+
highlightColor='#E0E0E'
14+
className="dark:bg-[#4B5563]"
15+
/>
1016
<div>
11-
<Skeleton width={100} height={20} />
17+
<Skeleton
18+
width={100}
19+
height={20}
20+
highlightColor='#E0E0E'
21+
className="dark:bg-[#4B5563]"
22+
/>
1223
</div>
1324
</div>
1425

15-
<Skeleton width={70} height={30} />
26+
<Skeleton
27+
width={70}
28+
height={30}
29+
highlightColor='#E0E0E'
30+
className="dark:bg-[#4B5563]"
31+
/>
1632

17-
<Skeleton width={50} height={20} />
33+
<Skeleton
34+
width={50}
35+
height={20}
36+
highlightColor='#E0E0E'
37+
className="dark:bg-[#4B5563]"
38+
/>
1839
</div>
1940
);
2041
}

src/Skeletons/SkeletonTable.tsx

+19-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import React from 'react';
32

43
interface SkeletonTableProps {
@@ -11,18 +10,30 @@ function SkeletonTable({ columns }: SkeletonTableProps) {
1110
<thead>
1211
<tr>
1312
{columns.map((column: any, index: React.Key | null | undefined) => (
14-
<th key={column.id || column.name} className="px-6 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
15-
<div className="h-4 bg-gray-300 rounded w-3/4" aria-label="Loading skeleton" />
13+
<th
14+
key={column.id || column.name}
15+
className="px-6 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider dark:bg-[#0A1729] dark:text-gray-400"
16+
>
17+
<div
18+
className="h-4 bg-gray-300 rounded w-3/4 dark:bg-gray-700"
19+
aria-label="Loading skeleton"
20+
/>
1621
</th>
1722
))}
1823
</tr>
1924
</thead>
2025
<tbody>
21-
{[...Array(5)].map((_, rowIndex:any) => (
26+
{[...Array(5)].map((_, rowIndex: any) => (
2227
<tr key={rowIndex.id || rowIndex.name}>
23-
{columns.map((_, colIndex:any) => (
24-
<td key={colIndex.id || colIndex.name} className="px-6 py-4 border-b border-gray-200 bg-white text-sm">
25-
<div className="h-4 bg-gray-300 rounded w-full" aria-label="Loading skeleton" />
28+
{columns.map((_, colIndex: any) => (
29+
<td
30+
key={colIndex.id || colIndex.name}
31+
className="px-6 py-4 border-b border-gray-200 bg-white text-sm dark:bg-[#0A1731] dark:border-gray-400"
32+
>
33+
<div
34+
className="h-4 bg-gray-300 rounded w-full dark:bg-gray-700"
35+
aria-label="Loading skeleton"
36+
/>
2637
</td>
2738
))}
2839
</tr>
@@ -32,4 +43,4 @@ function SkeletonTable({ columns }: SkeletonTableProps) {
3243
);
3344
}
3445

35-
export default SkeletonTable;
46+
export default SkeletonTable;

0 commit comments

Comments
 (0)