Skip to content

Commit d3a27fd

Browse files
committed
refactor: 로딩상태일 때 스피너 추가
1 parent 1b9ad2c commit d3a27fd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/(sub)/capsule-detail/_components/write-modal/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import RevealMotion from "@/shared/ui/motion/reveal-motion";
77
import ShakeYMotion from "@/shared/ui/motion/shakeY-motion";
88
import PopupConfirmLetter from "@/shared/ui/popup/popup-confirm-letter";
99
import PopupWarningLetter from "@/shared/ui/popup/popup-warning-letter";
10-
10+
import { PulseLoader } from "react-spinners";
1111
import { useWriteLetter } from "@/shared/api/mutations/letter";
1212
import type { CapsuleDetailRes } from "@/shared/types/api/capsule";
1313
import type { WriteLetterReq } from "@/shared/types/api/letter";
@@ -123,9 +123,9 @@ const WriteModal = ({
123123
<button
124124
type="submit"
125125
className={styles.title}
126-
disabled={isPending || isUploading}
126+
disabled={(isPending || isUploading)}
127127
>
128-
{isPending ? "제출 중..." : isUploading ? "업로드 중..." : "편지담기"}
128+
{(isPending || isUploading) ? <PulseLoader color="#FFFFFF" size={5}/> : '편지담기'}
129129
</button>
130130
</div>
131131

app/(sub)/capsule-detail/_components/write-modal/write-modal.css.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ export const content = style({
6969
});
7070

7171
export const title = style({
72+
display: "flex",
73+
alignItems: "center",
74+
justifyContent: "center",
7275
...themeVars.text.B1,
7376
color: themeVars.color.purple[10],
7477
margin: 0,

0 commit comments

Comments
 (0)