Skip to content

Commit

Permalink
style 로딩 인디게이터
Browse files Browse the repository at this point in the history
  • Loading branch information
dutexion committed Aug 20, 2024
1 parent 0f8b74d commit 7a26f48
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/components/common/Loding.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { theme } from '@/style/theme';
import styled from '@emotion/styled';

const LoadingIndicatorStyle = styled.div`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
`;

const SpinnerStyle = styled.div<{ size: number }>`
border: 4px solid ${theme.color.gray3};
border-top: 4px solid ${theme.color.main};
border-radius: 50%;
width: ${({ size }) => size + 'px'};
height: ${({ size }) => size + 'px'};
animation: spin 1s linear infinite;
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
`;

const Loading = ({ size = 40 }: { size?: number }) => {
return (
<LoadingIndicatorStyle>
<SpinnerStyle size={size} />
</LoadingIndicatorStyle>
);
};

export default Loading;

0 comments on commit 7a26f48

Please sign in to comment.