diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 725e9e4..d5841ad 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -20,6 +20,9 @@ jobs: echo "API_HOST=${{ vars.API_HOST }}" >> .env echo "NODE_ENV=${{ vars.NODE_ENV }}" >> .env echo "NEXT_PUBLIC_GA_ID=${{ secrets.PUBLIC_GA_ID }}" >> .env + echo "AUTH_KAKAO_ID=${{secrets.AUTH_KAKAO_ID}}" >> .env + echo "AUTH_KAKAO_SECRET=${{secrets.AUTH_KAKAO_SECRET}}" >> .env + echo "AUTH_SECRET=${{secrets.AUTH_SECRET}}" >> .env - name: Build docker image run: docker build -t ${{ vars.DOCKER_IMAGE }} . - name: Login to DockerHub diff --git a/public/icons/arrow_down.svg b/public/icons/arrow_down.svg new file mode 100644 index 0000000..f1d9ce2 --- /dev/null +++ b/public/icons/arrow_down.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/icons/arrow_up.svg b/public/icons/arrow_up.svg new file mode 100644 index 0000000..6e4e3dc --- /dev/null +++ b/public/icons/arrow_up.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/icons/check.svg b/public/icons/check.svg new file mode 100644 index 0000000..fc2dcf7 --- /dev/null +++ b/public/icons/check.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/app/(home)/components/TotalCount.tsx b/src/app/(home)/components/TotalCount.tsx index 0f37ab0..13e489b 100644 --- a/src/app/(home)/components/TotalCount.tsx +++ b/src/app/(home)/components/TotalCount.tsx @@ -6,7 +6,7 @@ const TotalCount = async () => { if (!sharedCount) return null return ( -
+
지금까지 {sharedCount.toLocaleString()}개의 보드가 만들어졌어요! diff --git a/src/app/mypage/leave/components/LeaveConfirmModal.tsx b/src/app/mypage/leave/components/LeaveConfirmModal.tsx new file mode 100644 index 0000000..afdaf02 --- /dev/null +++ b/src/app/mypage/leave/components/LeaveConfirmModal.tsx @@ -0,0 +1,22 @@ +import Modal from '@/components/Modal' +import TwoPolaroidsIcon from 'public/icons/twopolaroids.svg' + +interface LeaveConfirmModalProps { + isOpen: boolean + onClose: () => void +} +const LeaveConfirmModal = ({ isOpen, onClose }: LeaveConfirmModalProps) => { + const title = 'POLABO 탈퇴가 완료되었습니다.' + const content = '그동안 POLABO를\n이용해주셔서 감사합니다.' + return ( + + }> + {title} + {content} + + + + ) +} + +export default LeaveConfirmModal diff --git a/src/app/mypage/leave/components/LeaveForm.tsx b/src/app/mypage/leave/components/LeaveForm.tsx new file mode 100644 index 0000000..2c1fe04 --- /dev/null +++ b/src/app/mypage/leave/components/LeaveForm.tsx @@ -0,0 +1,91 @@ +'use client' + +import TextArea from '@/components/TextArea' +import Button from '@/components/Button' +import { useEffect, useState } from 'react' +import Select from '@/components/Select' +import { withdraw } from '@/lib' +import { signOut } from 'next-auth/react' +import LeaveConfirmModal from './LeaveConfirmModal' + +const WITHDRAW_TYPE = { + SELECT: '선택해주세요.', + UNUSED: '더 이상 이용하지 않아요.', + PRIVACY: '개인정보가 걱정돼요.', + DELETE_DATA: '제 데이터를 삭제하고 싶어요.', + NEW_ACCOUNT: '새로운 계정을 만들고 싶어요.', + ETC: '기타', +} + +const LeaveForm = () => { + const [withdrawType, setWithdrawType] = useState(WITHDRAW_TYPE.SELECT) + const [customReason, setCustomReason] = useState('') + const [isFormValid, setIsFormValid] = useState(false) + const [isLeaveConfirmModalOpen, setIsLeaveConfirmModalOpen] = useState(false) + const errorMessage = + customReason.length > 50 ? '50자까지 입력 가능합니다.' : '' + const isCustomReasonValid = customReason && !errorMessage + + useEffect(() => { + if (withdrawType === WITHDRAW_TYPE.SELECT) { + setIsFormValid(false) + } else if (withdrawType === WITHDRAW_TYPE.ETC && !isCustomReasonValid) { + setIsFormValid(false) + } else { + setIsFormValid(true) + } + }, [withdrawType, customReason]) + + const submit = async () => { + if (!isFormValid) { + return + } + + await withdraw({ + type: withdrawType, + reason: customReason, + }) + + setIsLeaveConfirmModalOpen(true) + } + + const onCloseLeaveConfirmModal = () => { + signOut({ callbackUrl: '/' }) + } + + return ( +
+
+