-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathLoader.jsx
More file actions
42 lines (36 loc) · 1023 Bytes
/
Loader.jsx
File metadata and controls
42 lines (36 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { CirclesToRhombusesSpinner } from 'react-epic-spinners'
import { LoaderText, LoaderContainer } from './styled';
const Loader = () => {
const letters = ['L', 'O', 'A', 'D', 'I', 'N', 'G'];
const generateUniqueId = () => {
let id = 0;
return () => {
id += 1;
return id.toString();
};
};
const uniqueIdGenerator = generateUniqueId();
return (
<LoaderContainer>
{letters.map((letter, index) => {
if (index === 1) {
return (
<CirclesToRhombusesSpinner
key={uniqueIdGenerator()}
animation-duration={1200}
circles-num={3}
circle-size={50}
color="#000"
/>
);
}
return (
<LoaderText key={uniqueIdGenerator()} bounceIndex={index}>
{letter}
</LoaderText>
);
})}
</LoaderContainer>
);
};
export default Loader;