Skip to content

Commit 4c5c4d8

Browse files
authored
Revert "fix: multiple hash loader with different color renders as the same color" (#605)
Revert "fix: multiple hash loader with different color renders as the same co…" This reverts commit ae4a2c5.
1 parent 7e1a35c commit 4c5c4d8

File tree

5 files changed

+4
-21
lines changed

5 files changed

+4
-21
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ on:
66
pull_request:
77
branches: [main]
88

9-
concurrency:
10-
group: ${{ github.workflow }}-${{ github.ref }}
11-
cancel-in-progress: true
12-
139
permissions:
1410
contents: read
1511
pages: write

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ umd
1818
.yarn/cache
1919
.yarn/install-state.gz
2020
stories/*.tsx
21-
storybook-static
22-
coverage
21+
storybook-static

src/helpers/animation.server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ describe("animation", () => {
1111
"0% {left: -35%;right: 100%} 60% {left: 100%;right: -90%} 100% {left: 100%;right: -90%}",
1212
"my-suffix"
1313
);
14-
expect(name).toMatch(/^react-spinners-TestLoader-my-suffix/);
14+
expect(name).toEqual("react-spinners-TestLoader-my-suffix");
1515
});
1616
});

src/helpers/animation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ describe("createAnimation", () => {
77
"0% {left: -35%;right: 100%} 60% {left: 100%;right: -90%} 100% {left: 100%;right: -90%}",
88
"my-suffix"
99
);
10-
expect(name).toMatch(/^react-spinners-TestLoader-my-suffix/);
10+
expect(name).toEqual("react-spinners-TestLoader-my-suffix");
1111
});
1212
});

src/helpers/animation.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const createAnimation = (loaderName: string, frames: string, suffix: string): string => {
2-
const animationName = `react-spinners-${loaderName}-${suffix}-${animationSuffix(10)}`;
2+
const animationName = `react-spinners-${loaderName}-${suffix}`;
33

44
if (typeof window == "undefined" || !window.document) {
55
return animationName;
@@ -21,15 +21,3 @@ export const createAnimation = (loaderName: string, frames: string, suffix: stri
2121

2222
return animationName;
2323
};
24-
25-
function animationSuffix(length: number) {
26-
let result = "";
27-
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
28-
const charactersLength = characters.length;
29-
let counter = 0;
30-
while (counter < length) {
31-
result += characters.charAt(Math.floor(Math.random() * charactersLength));
32-
counter += 1;
33-
}
34-
return result;
35-
}

0 commit comments

Comments
 (0)