• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

davidhu2000 / react-spinners / 14454581125

14 Apr 2025 07:59PM UTC coverage: 71.708% (-2.7%) from 74.385%
14454581125

push

github

web-flow
chore: update-all-packages (#631)

update-all-packages

1154 of 1753 branches covered (65.83%)

Branch coverage included in aggregate %.

18 of 25 new or added lines in 14 files covered. (72.0%)

120 existing lines in 23 files now uncovered.

1122 of 1421 relevant lines covered (78.96%)

6.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

69.84
/src/ClockLoader.tsx
1
import * as React from "react";
2

1✔
3
import { parseLengthAndUnit } from "./helpers/unitConverter";
1!
4
import { LoaderSizeProps } from "./helpers/props";
×
5
import { createAnimation } from "./helpers/animation";
×
6

×
7
const rotate = createAnimation("ClockLoader", "100% { transform: rotate(360deg) }", "rotate");
×
8

9
function ClockLoader({
×
10
  loading = true,
11
  color = "#000000",
1✔
12
  speedMultiplier = 1,
13
  cssOverride = {},
1!
14
  size = 50,
41!
15
  ...additionalprops
41✔
16
}: LoaderSizeProps): React.JSX.Element | null {
41!
17
  const { value, unit } = parseLengthAndUnit(size);
41✔
18

19
  const wrapper: React.CSSProperties = {
41✔
20
    display: "inherit",
21
    position: "relative",
×
22
    width: `${value}${unit}`,
×
23
    height: `${value}${unit}`,
24
    backgroundColor: "transparent",
1!
25
    boxShadow: `inset 0px 0px 0px 2px ${color}`,
1✔
26
    borderRadius: "50%",
27
    ...cssOverride,
×
28
  };
29

1✔
30
  const minute: React.CSSProperties = {
1✔
31
    position: "absolute",
1!
UNCOV
32
    backgroundColor: color,
×
UNCOV
33
    width: `${value / 3}px`,
×
UNCOV
34
    height: "2px",
×
35
    top: `${value / 2 - 1}px`,
36
    left: `${value / 2 - 1}px`,
1✔
37
    transformOrigin: "1px 1px",
38
    animation: `${rotate} ${8 / speedMultiplier}s linear infinite`,
1✔
39
  };
1!
40

1✔
41
  const hour: React.CSSProperties = {
41!
42
    position: "absolute",
1✔
43
    backgroundColor: color,
1✔
44
    width: `${value / 2.4}px`,
45
    height: "2px",
46
    top: `${value / 2 - 1}px`,
1✔
47
    left: `${value / 2 - 1}px`,
3✔
48
    transformOrigin: "1px 1px",
3✔
49
    animation: `${rotate} ${2 / speedMultiplier}s linear infinite`,
1✔
50
  };
3!
51

3✔
UNCOV
52
  if (!loading) {
×
UNCOV
53
    return null;
×
54
  }
55

3✔
56
  return (
57
    <span style={wrapper} {...additionalprops}>
1✔
58
      <span style={hour} />
1✔
59
      <span style={minute} />
1✔
60
    </span>
1✔
61
  );
1✔
62
}
63

3!
64
export default ClockLoader;
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc