({
loading = true,
color = "#000000",
speedMultiplier = 1,
cssOverride = {},
size = 15,
margin = 2,
...additionalprops
}: LoaderSizeMarginProps)
| 15 | ); |
| 16 | |
| 17 | function SyncLoader({ |
| 18 | loading = true, |
| 19 | color = "#000000", |
| 20 | speedMultiplier = 1, |
| 21 | cssOverride = {}, |
| 22 | size = 15, |
| 23 | margin = 2, |
| 24 | ...additionalprops |
| 25 | }: LoaderSizeMarginProps) { |
| 26 | const wrapper: React.CSSProperties = { |
| 27 | display: "inherit", |
| 28 | ...cssOverride, |
| 29 | }; |
| 30 | |
| 31 | const style = (i: number): React.CSSProperties => { |
| 32 | return { |
| 33 | backgroundColor: color, |
| 34 | width: cssValue(size), |
| 35 | height: cssValue(size), |
| 36 | margin: cssValue(margin), |
| 37 | borderRadius: "100%", |
| 38 | display: "inline-block", |
| 39 | animation: `${sync} ${0.6 / speedMultiplier}s ${i * 0.07}s infinite ease-in-out`, |
| 40 | animationFillMode: "both", |
| 41 | }; |
| 42 | }; |
| 43 | |
| 44 | if (!loading) { |
| 45 | return null; |
| 46 | } |
| 47 | |
| 48 | return ( |
| 49 | <span style={wrapper} {...additionalprops}> |
| 50 | <span style={style(1)} /> |
| 51 | <span style={style(2)} /> |
| 52 | <span style={style(3)} /> |
| 53 | </span> |
| 54 | ); |
| 55 | } |
| 56 | |
| 57 | export default SyncLoader; |
nothing calls this directly
no test coverage detected
searching dependent graphs…