Skip to content

Commit 57eb6b7

Browse files
committed
fix: skeleton delay not being applied
1 parent 4fdc49d commit 57eb6b7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/components/skeleton/src/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ export const Skeleton = ({
2727
const N = useMemo(() => (n += 1 % 3), []);
2828

2929
useEffect(() => {
30-
if (variation === "default") return;
31-
3230
setIndex((n += 1));
3331

3432
return () => {
3533
n -= 1;
34+
3635
setIndex(undefined);
3736
};
3837
}, [variation]);
@@ -48,7 +47,8 @@ export const Skeleton = ({
4847
"--index": N,
4948
}),
5049
}}
51-
{...otherProps}
52-
/>
50+
{...otherProps}>
51+
{index} / {N}
52+
</div>
5353
);
5454
};

packages/components/skeleton/src/styles/index.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
transform: translateX(-100%);
2828
animation: move 2s linear infinite;
2929
background-image: linear-gradient(90deg, transparent, get-color(neutral-light-3), transparent);
30-
animation-delay: calc(var(--n) * 200ms);
30+
animation-delay: calc(var(--index) * 200ms);
3131
}
3232
}
3333

0 commit comments

Comments
 (0)