File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
packages/thirdweb/src/react/web/ui/components Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Fix Spinner animation not working sometimes in Next.js
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { keyframes } from "@emotion/react";
33import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js" ;
44import type { Theme } from "../../../core/design-system/index.js" ;
55import { iconSize } from "../../../core/design-system/index.js" ;
6- import { StyledCircle , StyledSvg } from "../design-system/elements.js" ;
6+ import { StyledSvg } from "../design-system/elements.js" ;
77
88/**
99 * @internal
@@ -24,20 +24,25 @@ export const Spinner: React.FC<{
2424 viewBox = "0 0 50 50"
2525 className = "tw-spinner"
2626 >
27- < Circle
27+ < circle
2828 cx = "25"
2929 cy = "25"
3030 fill = "none"
3131 r = "20"
32+ style = { {
33+ strokeLinecap : "round" ,
34+ animation : `tw-spinner-circle-dash 1.5s ease-in-out infinite` ,
35+ } }
3236 stroke = { props . color ? theme . colors [ props . color ] : "currentColor" }
3337 strokeWidth = { Number ( iconSize [ props . size ] ) > 64 ? "2" : "4" }
3438 />
39+ < style > { dashAnimation } </ style >
3540 </ Svg >
3641 ) ;
3742} ;
38-
3943// animations
40- const dashAnimation = keyframes `
44+ const dashAnimation = `
45+ @keyframes tw-spinner-circle-dash {
4146 0% {
4247 stroke-dasharray: 1, 150;
4348 stroke-dashoffset: 0;
@@ -63,8 +68,3 @@ const Svg = /* @__PURE__ */ StyledSvg({
6368 height : "1em" ,
6469 width : "1em" ,
6570} ) ;
66-
67- const Circle = /* @__PURE__ */ StyledCircle ( {
68- animation : `${ dashAnimation } 1.5s ease-in-out infinite` ,
69- strokeLinecap : "round" ,
70- } ) ;
You can’t perform that action at this time.
0 commit comments