-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 로딩 컴포넌트에 접시 스피너 추가 * refactor: 스피너 애니메이션 수정
- Loading branch information
1 parent
66a2147
commit 2e77d12
Showing
1 changed file
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,49 @@ | ||
const Loading = () => { | ||
return <div>로딩중..</div>; | ||
import { Text } from '@fun-eat/design-system'; | ||
import styled, { keyframes } from 'styled-components'; | ||
|
||
import PlateImage from '@/assets/plate.svg'; | ||
|
||
const DEFAULT_DESCRIPTION = '잠시만 기다려주세요 🥄'; | ||
|
||
interface LoadingProps { | ||
customHeight?: string; | ||
description?: string; | ||
} | ||
|
||
const Loading = ({ customHeight = '100%', description = DEFAULT_DESCRIPTION }: LoadingProps) => { | ||
return ( | ||
<LoadingContainer customHeight={customHeight}> | ||
<PlateImageWrapper> | ||
<PlateImage width={120} /> | ||
</PlateImageWrapper> | ||
<Text align="center">{description}</Text> | ||
</LoadingContainer> | ||
); | ||
}; | ||
|
||
export default Loading; | ||
|
||
type LoadingContainerStyleProps = Pick<LoadingProps, 'customHeight'>; | ||
|
||
const LoadingContainer = styled.div<LoadingContainerStyleProps>` | ||
display: flex; | ||
flex-direction: column; | ||
row-gap: 36px; | ||
justify-content: center; | ||
align-items: center; | ||
height: ${({ customHeight }) => customHeight}; | ||
`; | ||
|
||
const rotate = keyframes` | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(-360deg); | ||
} | ||
`; | ||
|
||
const PlateImageWrapper = styled.div` | ||
animation: ${rotate} 1.5s ease-in-out infinite; | ||
`; |