diff --git a/src/components/Forms/UserRegisterForm/index.tsx b/src/components/Forms/UserRegisterForm/index.tsx index 3cbdd4c8..13a10a50 100644 --- a/src/components/Forms/UserRegisterForm/index.tsx +++ b/src/components/Forms/UserRegisterForm/index.tsx @@ -13,6 +13,7 @@ import { flex, palettes, titleBarHeight } from '~/styles/utils'; export type UserRegisterFormOptions = Partial<{ titleBarTitle: string; + onClickClose?: () => void; }>; export interface UserRegisterFormProps { @@ -33,7 +34,7 @@ const UserRegisterForm = (props: UserRegisterFormProps) => { className, options = {}, } = props; - const { titleBarTitle } = options; + const { titleBarTitle, onClickClose } = options; const methods = useForm({ defaultValues, }); @@ -55,9 +56,9 @@ const UserRegisterForm = (props: UserRegisterFormProps) => {
void; } +interface OpenSignOutReconfirmModalParams { + description?: string; + actionText?: string; +} + export const useSignOutReconfirmModal = ( options: Partial = {} ) => { @@ -26,14 +31,20 @@ export const useSignOutReconfirmModal = ( } }; - const openSignOutReconfirmModal = () => { + const openSignOutReconfirmModal = ( + params: OpenSignOutReconfirmModalParams = {} + ) => { if (!myInfo) return; + const { + description = `${myInfo?.nickname}님 로그아웃 하시겠습니까?`, + actionText = '로그아웃', + } = params; openModal('alert', { title: '알림', - description: `${myInfo?.nickname}님 로그아웃 하시겠습니까?`, + description, cancelText: '취소', - actionText: '로그아웃', + actionText, onClickAction: handleClickAction, onClickCancel: closeModal, }); diff --git a/src/pages/auth/register/index.tsx b/src/pages/auth/register/index.tsx index a933fbc6..3db05db6 100644 --- a/src/pages/auth/register/index.tsx +++ b/src/pages/auth/register/index.tsx @@ -13,7 +13,7 @@ import { Logo } from '~/components/Common/Logo'; import { PageHeadingText } from '~/components/Common/PageHeadingText'; import { SsafyIcon } from '~/components/Common/SsafyIcon'; import { ErrorMessageWithSsafyIcon } from '~/components/ErrorMessageWithSsafyIcon'; -import { Footer } from '~/components/Footer'; +import { useSignOutReconfirmModal } from '~/hooks'; import { useMyAccountStatus, useUpdateMyInfo } from '~/services/member'; import { useTermsOfService } from '~/services/meta/hooks/useTermsOfService'; import { @@ -41,6 +41,7 @@ const titleBarTitle = metaTitle; const RegisterPage: CustomNextPage = () => { const router = useRouter(); const { isRegisterRequired } = useMyAccountStatus(); + const { openSignOutReconfirmModal } = useSignOutReconfirmModal(); const { mutateAsync: updateMyInfo } = useUpdateMyInfo(); const [shouldCheckUserInfo, setShouldCheckUserInfo] = useState(true); const { @@ -71,6 +72,13 @@ const RegisterPage: CustomNextPage = () => { } }; + const onClickClose = () => { + openSignOutReconfirmModal({ + actionText: '종료', + description: '회원가입을 종료합니다.', + }); + }; + return ( <> @@ -81,7 +89,7 @@ const RegisterPage: CustomNextPage = () => { {isTermsSuccess && (