-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from Team-Lecue/refactor/CreateNote
dev로 들어가걸아ㅏ ~~!!!!!!!!
- Loading branch information
Showing
15 changed files
with
217 additions
and
21 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
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
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
21 changes: 21 additions & 0 deletions
21
src/LecueNote/components/WriteNote/NoteLoading/NoteLoading.style.ts
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const LoadingWrapper = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
border: 0.6rem; | ||
background-color: ${({ theme }) => theme.colors.background}; | ||
`; | ||
|
||
export const LottieWrapper = styled.div` | ||
width: 10rem; | ||
height: 10rem; | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Lottie from 'lottie-react'; | ||
import { useEffect } from 'react'; | ||
|
||
import animationData from '../../../../../src/assets/lottie/spiner 120.json'; | ||
import * as S from './NoteLoading.style'; | ||
|
||
interface NoteLoadingProps { | ||
handleResetPrevImg: () => void; | ||
} | ||
const NoteLoading = ({ handleResetPrevImg }: NoteLoadingProps) => { | ||
useEffect(() => { | ||
handleResetPrevImg(); | ||
}, []); | ||
|
||
return ( | ||
<S.LoadingWrapper> | ||
<S.LottieWrapper> | ||
<Lottie animationData={animationData} /> | ||
</S.LottieWrapper> | ||
</S.LoadingWrapper> | ||
); | ||
}; | ||
|
||
export default NoteLoading; |
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
interface handleClickFiletoBinaryProps { | ||
file: File; | ||
reader: FileReader; | ||
handleReaderOnloadend: (reader: FileReader, file: File) => void; | ||
} | ||
|
||
const handleClickFiletoBinary = ({ | ||
file, | ||
reader, | ||
handleReaderOnloadend, | ||
}: handleClickFiletoBinaryProps) => { | ||
reader.readAsArrayBuffer(file); | ||
// reader1의 비동기 작업이 완료된 후 수행(onloadend() 활용) | ||
reader.onloadend = () => { | ||
handleReaderOnloadend(reader, file); | ||
}; | ||
}; | ||
|
||
export default handleClickFiletoBinary; |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
interface handleClickFiletoStringProps { | ||
file: File; | ||
reader: FileReader; | ||
handleTransformImgFile: (file: string | FileReader) => void; | ||
} | ||
|
||
const handleClickFiletoString = ({ | ||
file, | ||
reader, | ||
handleTransformImgFile, | ||
}: handleClickFiletoStringProps) => { | ||
reader.readAsDataURL(file); | ||
reader.onloadend = () => { | ||
if (reader.result !== null) { | ||
handleTransformImgFile(reader.result as string); | ||
} | ||
}; | ||
}; | ||
|
||
export default handleClickFiletoString; |
Oops, something went wrong.