-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathLoading.js
More file actions
41 lines (36 loc) · 857 Bytes
/
Copy pathLoading.js
File metadata and controls
41 lines (36 loc) · 857 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
import React from 'react';
import styled from '@emotion/styled';
import { LIB_NAME } from '../constants';
const Loading = ({ props }) =>
props.loadingRenderer ? (
props.loadingRenderer({ props })
) : (
<LoadingComponent className={`${LIB_NAME}-loading`} color={props.color} />
);
const LoadingComponent = styled.div`
@keyframes dual-ring-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(180deg);
}
}
padding: 0 5px;
display: block;
width: auto;
height: auto;
:after {
content: ' ';
display: block;
width: 16px;
height: 16px;
border-radius: 50%;
border-width: 1px;
border-style: solid;
border-color: ${({ color }) => color} transparent;
animation: dual-ring-spin 0.7s ease-in-out infinite;
margin: 0 0 0 -10px;
}
`;
export default Loading;