Skip to content

Commit

Permalink
Fix loading flickering on home page
Browse files Browse the repository at this point in the history
  • Loading branch information
aberonni committed Jan 26, 2024
1 parent 1f2566e commit ad7acb9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/data-table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ export function DataTable<TData, TValue = unknown>({
Array.from({ length: 5 }).map((_, i) => (
<TableRow key={i}>
{table.getVisibleFlatColumns().map((col, j) => (
<TableCell key={j}>
<Skeleton className="my-0.5 h-[18px] w-[200px]" />
<TableCell key={j} className="h-[40px]">
<Skeleton
className="h-[18px]"
style={{ width: `${60 + ((i + j) % 3) * 40}px` }}
/>
</TableCell>
))}
</TableRow>
Expand All @@ -125,7 +128,7 @@ export function DataTable<TData, TValue = unknown>({
data-state={row.getIsSelected() && "selected"}
>
{row.getVisibleCells().map((cell) => (
<TableCell key={cell.id}>
<TableCell key={cell.id} className="h-[40px]">
{flexRender(
cell.column.columnDef.cell,
cell.getContext(),
Expand Down

0 comments on commit ad7acb9

Please sign in to comment.