Skip to content

Commit

Permalink
#73: feat: signout onCloseLeaveConfirmModal
Browse files Browse the repository at this point in the history
  • Loading branch information
junseublim committed Aug 11, 2024
1 parent 3aa424a commit 602fcb8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/app/mypage/leave/components/LeaveForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from '@/components/Button'
import { useEffect, useState } from 'react'
import Select from '@/components/Select'
import { withdraw } from '@/lib'
import { useRouter } from 'next/navigation'
import { signOut } from 'next-auth/react'
import LeaveConfirmModal from './LeaveConfirmModal'

const WITHDRAW_TYPE = {
Expand All @@ -26,8 +26,6 @@ const LeaveForm = () => {
customReason.length > 50 ? '50자까지 입력 가능합니다.' : ''
const isCustomReasonValid = customReason && !errorMessage

const router = useRouter()

useEffect(() => {
if (withdrawType === WITHDRAW_TYPE.SELECT) {
setIsFormValid(false)
Expand All @@ -48,13 +46,11 @@ const LeaveForm = () => {
reason: customReason,
})

// TODO: 탈퇴 후 로직

setIsLeaveConfirmModalOpen(true)
}

const onCloseLeaveConfirmModal = () => {
router.back()
signOut({ callbackUrl: '/' })
}

return (
Expand Down

0 comments on commit 602fcb8

Please sign in to comment.