-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathLoader.tsx
49 lines (39 loc) · 1003 Bytes
/
Loader.tsx
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
43
44
45
46
47
48
49
import React from "react";
import styled, { type CSSProperties, keyframes } from "styled-components";
import KlerosIcon from "svgs/icons/kleros.svg";
type Width = CSSProperties["width"];
type Height = CSSProperties["height"];
const breathing = keyframes`
0% {
transform: scale(1);
}
50% {
transform: scale(1.3);
}
100% {
transform: scale(1);
}
`;
const StyledKlerosIcon = styled(KlerosIcon)`
path {
fill: ${({ theme }) => theme.klerosUIComponentsStroke};
}
animation: ${breathing} 2s ease-out infinite normal;
`;
const Container = styled.div<{ width?: Width; height?: Height }>`
width: ${({ width }) => width ?? "100%"};
height: ${({ height }) => height ?? "100%"};
`;
interface ILoader {
width?: Width;
height?: Height;
className?: string;
}
const Loader: React.FC<ILoader> = ({ width, height, className }) => {
return (
<Container {...{ width, height, className }}>
<StyledKlerosIcon />
</Container>
);
};
export default Loader;