mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-02 02:30:29 +00:00
Complete spinner component
This commit is contained in:
@@ -1,7 +1,16 @@
|
|||||||
import { Wrapper } from './styles';
|
import { Wrapper } from './styles';
|
||||||
|
|
||||||
const Spinner = () => {
|
type SpinnerProps = {
|
||||||
return <Wrapper></Wrapper>;
|
color?: 'client' | 'productOwner' | 'developer' | 'admin';
|
||||||
|
fullScreen?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
const Spinner = ({ fullScreen = false, color = 'client' }: SpinnerProps) => {
|
||||||
|
return (
|
||||||
|
<Wrapper fullScreen={fullScreen} color={color}>
|
||||||
|
<div className='lds-dual-ring'></div>
|
||||||
|
</Wrapper>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Spinner;
|
export default Spinner;
|
||||||
|
|||||||
@@ -1,3 +1,50 @@
|
|||||||
import styled from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
|
|
||||||
export const Wrapper = styled.div``;
|
type WrapperProps = {
|
||||||
|
color?: 'client' | 'productOwner' | 'developer' | 'admin';
|
||||||
|
fullScreen?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const Wrapper = styled.div<WrapperProps>`
|
||||||
|
${({ fullScreen }) =>
|
||||||
|
fullScreen &&
|
||||||
|
css`
|
||||||
|
position: fixed;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
z-index: 99;
|
||||||
|
`}
|
||||||
|
|
||||||
|
.lds-dual-ring {
|
||||||
|
display: inline-block;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
.lds-dual-ring:after {
|
||||||
|
content: ' ';
|
||||||
|
display: block;
|
||||||
|
width: 35px;
|
||||||
|
height: 35px;
|
||||||
|
margin: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 6px solid
|
||||||
|
${({ theme, color }) =>
|
||||||
|
color ? theme.colors[color].main : theme.colors.client.main};
|
||||||
|
border-color: ${({ theme, color }) =>
|
||||||
|
color ? theme.colors[color].main : theme.colors.client.main}
|
||||||
|
transparent
|
||||||
|
${({ theme, color }) =>
|
||||||
|
color ? theme.colors[color].main : theme.colors.client.main}
|
||||||
|
transparent;
|
||||||
|
animation: lds-dual-ring 1.2s linear infinite;
|
||||||
|
}
|
||||||
|
@keyframes lds-dual-ring {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Button from './Button';
|
import Button from './Button';
|
||||||
|
import IconButton from './IconButton';
|
||||||
import Box from './Box';
|
import Box from './Box';
|
||||||
import Text from './Text';
|
import Text from './Text';
|
||||||
import Link from './Link';
|
import Link from './Link';
|
||||||
@@ -8,7 +9,19 @@ import Select from './Select';
|
|||||||
import Search from './Search';
|
import Search from './Search';
|
||||||
import Avatar from './Avatar';
|
import Avatar from './Avatar';
|
||||||
import ContextMenu from './ContextMenu';
|
import ContextMenu from './ContextMenu';
|
||||||
|
import Spinner from './Spinner';
|
||||||
|
|
||||||
|
export {
|
||||||
|
Button,
|
||||||
|
IconButton,
|
||||||
|
Box,
|
||||||
|
Text,
|
||||||
|
Link,
|
||||||
|
Input,
|
||||||
|
TextArea,
|
||||||
|
Select,
|
||||||
Search,
|
Search,
|
||||||
Avatar,
|
Avatar,
|
||||||
ContextMenu,
|
ContextMenu,
|
||||||
|
Spinner,
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user