Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/components/screens/EditProfileScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,27 @@ export default function EditProfileScreen({ onBack }) {
}
};

// 4. 회원 탈퇴
const stopbeingmember = async () => {
try {
setLoading(true);
await api.put(
"/member/deactivate",
{ headers: { Authorization: `Bearer ${token}` } }
);
setModal({ message: "회원 탈퇴가 완료되었습니다 ", type: "success" });
localStorage.clear();
setTimeout(() => {
navigate("/mypage");
onBack?.();
}, 1000);
} catch {
setModal({ message: "다시 시도해주세요", type: "error" });
} finally {
setLoading(false);
}
};

const nicknameValid = nickname.length >= 2;

return (
Expand Down Expand Up @@ -221,6 +242,15 @@ export default function EditProfileScreen({ onBack }) {
{loading ? "저장 중..." : "저장"}
</button>

{/* 회원 탈퇴 */}
<button
className="btn"
style={{ background: "#f25c5c" }}
onClick={stopbeingmember}
>
회원 탈퇴
</button>

{/* 뒤로가기 */}
<button
style={{
Expand Down
11 changes: 0 additions & 11 deletions src/components/screens/FaqScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,6 @@ export default function FaqScreen() {
/>
))}
</div>

{/* 하단 고객센터 정보 */}
<div className='mt-8 text-center text-gray-600'>
<p className='mb-2'>찾으시는 답변이 없으신가요?</p>
<a
href='#'
className='text-green-500 font-medium hover:underline'
>
1:1 문의하기
</a>
</div>
</div>
</div>
);
Expand Down