-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from teamViNO/feature-070
feature-070: 회원탈퇴 모달 구현
- Loading branch information
Showing
12 changed files
with
281 additions
and
117 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export { Account } from './Account'; | ||
export { LogoutModal } from './LogoutModal'; | ||
export { ServiceSetting } from './ServiceSetting'; |
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 was deleted.
Oops, something went wrong.
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,47 @@ | ||
import { | ||
BlurBackground, | ||
CommonCategoryContainer, | ||
CommonCloseButton, | ||
} from '@/styles/modals/common.style'; | ||
import CloseSvg from '@/assets/icons/close.svg?react'; | ||
import useOutsideClick from '@/hooks/useOutsideClick'; | ||
import AfterLogin from '@/assets/after-login.png'; | ||
import * as NoticeModalStyles from '@/styles/modals/NoticeModal.style'; | ||
|
||
interface IGuestNoticeModalProp { | ||
title: string; | ||
subTitle: string; | ||
to: string; | ||
buttonTitle: string; | ||
onButtonClick?: () => void; | ||
setIsNoticeModalOpen: React.Dispatch<React.SetStateAction<boolean>>; | ||
} | ||
|
||
const NoticeModal = ({ | ||
title, | ||
subTitle, | ||
to, | ||
buttonTitle, | ||
onButtonClick, | ||
setIsNoticeModalOpen, | ||
}: IGuestNoticeModalProp) => { | ||
const onCloseModal = () => setIsNoticeModalOpen(false); | ||
const [noticeModalRef] = useOutsideClick<HTMLDivElement>(onCloseModal); | ||
return ( | ||
<BlurBackground> | ||
<CommonCategoryContainer ref={noticeModalRef}> | ||
<CommonCloseButton onClick={onCloseModal}> | ||
<CloseSvg width={21.42} height={21.42} /> | ||
</CommonCloseButton> | ||
<img src={AfterLogin} /> | ||
<NoticeModalStyles.Title>{title}</NoticeModalStyles.Title> | ||
<NoticeModalStyles.SubTitle>{subTitle}</NoticeModalStyles.SubTitle> | ||
<NoticeModalStyles.Button to={to} onClick={onButtonClick}> | ||
{buttonTitle} | ||
</NoticeModalStyles.Button> | ||
</CommonCategoryContainer> | ||
</BlurBackground> | ||
); | ||
}; | ||
|
||
export default NoticeModal; |
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,87 @@ | ||
import { | ||
BlurBackground, | ||
CommonCategoryContainer, | ||
CommonCloseButton, | ||
} from '@/styles/modals/common.style'; | ||
import CloseSvg from '@/assets/icons/close.svg?react'; | ||
import useOutsideClick from '@/hooks/useOutsideClick'; | ||
import AfterLogin from '@/assets/after-login.png'; | ||
import * as WithdrawModalStyles from '@/styles/modals/WIthdrawModal.style'; | ||
|
||
interface IWithdrawModalProp { | ||
reason: string; | ||
setReason: React.Dispatch<React.SetStateAction<string>>; | ||
etcReason: string; | ||
setEtcReason: React.Dispatch<React.SetStateAction<string>>; | ||
setIsWithdrawModalOpen: React.Dispatch<React.SetStateAction<boolean>>; | ||
setIsNoticeModalOpen: React.Dispatch<React.SetStateAction<boolean>>; | ||
} | ||
|
||
const WithdrawModal = ({ | ||
reason, | ||
setReason, | ||
etcReason, | ||
setEtcReason, | ||
setIsWithdrawModalOpen, | ||
setIsNoticeModalOpen, | ||
}: IWithdrawModalProp) => { | ||
const onCloseModal = () => setIsWithdrawModalOpen(false); | ||
const options = [ | ||
'기록을 삭제하고 싶어요', | ||
'변환 결과가 마음에 들지 않아요', | ||
'이용이 불편하고 장애가 많아요', | ||
'사용빈도가 낮아요', | ||
'기타', | ||
]; | ||
const [withdrawModalRef] = useOutsideClick<HTMLDivElement>(onCloseModal); | ||
|
||
const handleModalState = (e: React.MouseEvent) => { | ||
e.stopPropagation(); | ||
setIsWithdrawModalOpen(false); | ||
setIsNoticeModalOpen(true); | ||
}; | ||
const handleInput = (e: React.ChangeEvent<HTMLInputElement>) => | ||
setEtcReason(e.target.value); | ||
|
||
return ( | ||
<BlurBackground> | ||
<CommonCategoryContainer ref={withdrawModalRef}> | ||
<CommonCloseButton onClick={onCloseModal}> | ||
<CloseSvg width={21.42} height={21.42} /> | ||
</CommonCloseButton> | ||
<img src={AfterLogin} /> | ||
<WithdrawModalStyles.Title> | ||
왜 탈퇴하시려고 하나요? | ||
</WithdrawModalStyles.Title> | ||
<WithdrawModalStyles.SubTitle> | ||
탈퇴를 결심한 이유를 알려주세요 | ||
</WithdrawModalStyles.SubTitle> | ||
{options.map((option) => ( | ||
<WithdrawModalStyles.SelectButton | ||
key={option} | ||
onClick={() => setReason(option)} | ||
className={`${option === reason && 'selected'}`} | ||
> | ||
{option} | ||
</WithdrawModalStyles.SelectButton> | ||
))} | ||
<WithdrawModalStyles.EtcInputWrap | ||
className={`${reason === '기타' && 'open'}`} | ||
> | ||
<WithdrawModalStyles.EtcInput | ||
value={etcReason} | ||
onChange={handleInput} | ||
/> | ||
</WithdrawModalStyles.EtcInputWrap> | ||
<WithdrawModalStyles.SubmitButton | ||
disabled={!reason} | ||
className={`${!reason && 'disabled'}`} | ||
onClick={handleModalState} | ||
> | ||
선택하기 | ||
</WithdrawModalStyles.SubmitButton> | ||
</CommonCategoryContainer> | ||
</BlurBackground> | ||
); | ||
}; | ||
export default WithdrawModal; |
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
Oops, something went wrong.