-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fire store에 저장하기 전, Cloudinary에 먼저 저장 + 이미지 변환 - 이미지 변환 후, fire store에 저장 - 저장하는 도중 로딩 스피너 - 저장에 성공시 대화창 표시 Resolves #12
- Loading branch information
Showing
10 changed files
with
256 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import ModalBox from '../templates/ModalBox'; | ||
import loadingSpinner from '../../images/loadingSpinner.svg'; | ||
import LoadingStyles from './Loading.module.css'; | ||
|
||
function Loading () { | ||
return ( | ||
<ModalBox> | ||
<section> | ||
<p className={LoadingStyles.message}> | ||
저장중 | ||
</p> | ||
<img className={LoadingStyles.loadingSpinner} src={loadingSpinner} alt="로딩 스피너"/> | ||
</section> | ||
</ModalBox> | ||
); | ||
} | ||
|
||
export default Loading; |
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,67 @@ | ||
.message { | ||
text-align: center; | ||
margin-bottom: 20px; | ||
font-size: 24px; | ||
} | ||
|
||
.btnBox { | ||
display: flex; | ||
} | ||
|
||
.btn { | ||
width: 48%; | ||
display: inline-block; | ||
font-size: 16px; | ||
border: 1px solid; | ||
padding: 20px; | ||
border-radius: 8px; | ||
box-sizing: border-box; | ||
text-align: center; | ||
word-break: keep-all; | ||
} | ||
|
||
.btn.point { | ||
background: #222; | ||
color: #fff; | ||
} | ||
|
||
.btn + .btn { | ||
margin-left: 4%; | ||
} | ||
|
||
@keyframes loading { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
12.5% { | ||
transform: rotate(45deg); | ||
} | ||
25% { | ||
transform: rotate(90deg); | ||
} | ||
37.5% { | ||
transform: rotate(135deg); | ||
} | ||
50% { | ||
transform: rotate(180deg); | ||
} | ||
62.5% { | ||
transform: rotate(225deg); | ||
} | ||
75% { | ||
transform: rotate(270deg); | ||
} | ||
87.5% { | ||
transform: rotate(315deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
.loadingSpinner { | ||
display: block; | ||
margin: 0px auto; | ||
width: 50%; | ||
animation: loading 2.5s step-end infinite; | ||
} |
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 React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import ModalBox from '../templates/ModalBox'; | ||
import LoadingStyles from './Loading.module.css'; | ||
|
||
function LoadingSuccess ({setLoading}) { | ||
const onBack = () => { | ||
setLoading(()=>'ready'); | ||
} | ||
|
||
return ( | ||
<ModalBox> | ||
<section> | ||
<p className={LoadingStyles.message}>친구 저장 완료</p> | ||
<div className={LoadingStyles.btnBox}> | ||
<button className={LoadingStyles.btn} onClick={onBack}>더 많은 친구</button> | ||
<Link className={`${LoadingStyles.btn} ${LoadingStyles.point}`} to="/list">친구 리스트</Link> | ||
</div> | ||
</section> | ||
</ModalBox> | ||
); | ||
} | ||
|
||
export default LoadingSuccess; |
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,12 @@ | ||
import React from 'react'; | ||
import ModalBoxStyles from './ModalBox.module.css'; | ||
|
||
function ModalBox ({children}) { | ||
return ( | ||
<div className={ModalBoxStyles.background}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
export default ModalBox; |
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,23 @@ | ||
.background { | ||
position: fixed; | ||
top: 0px; | ||
bottom: 0px; | ||
left: 0px; | ||
right: 0px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: rgba(0, 0, 0, 0.8); | ||
backdrop-filter: blur(15px); | ||
z-index: 3000; | ||
padding: 20px; | ||
box-sizing: border-box; | ||
overflow: auto; | ||
} | ||
|
||
.background > section { | ||
background-color: #fff; | ||
padding: 40px; | ||
box-sizing: border-box; | ||
border-radius: 8px; | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,13 @@ | ||
const cloud_name = process.env.REACT_APP_CLOUD_NAME; | ||
const url = `https://api.cloudinary.com/v1_1/${cloud_name}/image/upload`; | ||
|
||
class ImageService { | ||
uploadImg(formData) { | ||
return fetch(url, { | ||
method: "POST", | ||
body: formData, | ||
}); | ||
} | ||
} | ||
|
||
export default ImageService; |