Skip to content

Commit

Permalink
Fix: conflict 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
eunji-0623 committed Jun 16, 2024
2 parents 0f69586 + 0597f4c commit b807782
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
7 changes: 7 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build]
command = "npm run build"
publish = "dist"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
1 change: 1 addition & 0 deletions public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
1 change: 0 additions & 1 deletion src/components/UserProfileImg/UserProfileImg.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
width: 38px;
height: 38px;
border: 1px solid #d9d9d9;
object-fit: cover;
}

.MembersProfileImg {
Expand Down
10 changes: 4 additions & 6 deletions src/pages/login-signup/components/utils/useSignUpForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function useSignUpForm() {

// 이외의 상태 관리
const [loading, setLoading] = useState(false);
const [, setError] = useState<string | null>(null);
const [isModalOpen, setIsModalOpen] = useState(false);
const [isErrorModalOpen, setIsErrorModalOpen] = useState(false);
const navigate = useNavigate();
Expand Down Expand Up @@ -60,19 +61,16 @@ function useSignUpForm() {
const handleSubmit = async (e: { preventDefault: () => void }) => {
e.preventDefault();
setLoading(true); // 회원가입 시도 중에는 버튼 비활성화
setError(null);

const { email, nickname, password } = values;

try {
await apiSignUp({
email,
nickname,
password,
}); // 회원가입 API 호출

await apiSignUp({ email, nickname, password }); // 회원가입 API 호출
setIsModalOpen(true); // 성공 시 모달 창 띄우기
} catch (error) {
setIsErrorModalOpen(true);
setError('중복된 이메일입니다.');
} finally {
setLoading(false); // 회원가입 시도가 끝나면 버튼 활성화
}
Expand Down

0 comments on commit b807782

Please sign in to comment.