From 5d3c419b3c05a588ef31ca43d7b4c985cb8b02d8 Mon Sep 17 00:00:00 2001 From: hojin Date: Sat, 8 Jun 2024 16:25:41 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EB=B0=9C=EA=B2=AC,=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=ED=8A=B8=EB=A6=AC=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/auth/auth.post.api.ts | 2 +- src/components/layout/Layout.tsx | 6 ++--- src/components/{ => layout}/footer/Footer.tsx | 0 src/components/{ => layout}/header/Header.tsx | 0 .../{ => layout}/header/ReservationHeader.tsx | 0 .../{ => sign}/backarrow/BackArrow.tsx | 0 .../findpassword/ChangePasswordDone.tsx | 2 +- .../findpassword/EmailCertification.tsx | 2 +- .../findpassword/NewPasswordForm.tsx | 0 .../{ => sign}/findpassword/SetNewPasswod.tsx | 2 +- .../{ => sign}/signin/SigninForm.tsx | 24 ------------------- .../{ => sign}/signup/EmailVerification.tsx | 5 ++-- .../{ => sign}/signup/JobPosition.tsx | 0 .../{ => sign}/signup/JobPositionItem.tsx | 0 .../signup/PasswordVerification.tsx | 2 +- .../{ => sign}/signup/PhoneCertification.tsx | 3 ++- .../{ => sign}/signup/SignupDone.tsx | 2 +- src/components/{ => sign}/signup/Terms.tsx | 0 .../{ => sign}/signup/terms/TermsItem.tsx | 0 .../{ => sign}/signup/terms/TermsModal.tsx | 0 .../{ => sign}/signup/terms/TermsTitle.tsx | 0 src/hook/useLogin.ts | 16 ++++++------- src/pages/index.tsx | 2 +- src/pages/map/index.tsx | 4 ++-- src/pages/mypage/changepassword/index.tsx | 4 ++-- src/pages/mypage/changeprofile/index.tsx | 2 +- src/pages/mypage/guide/index.tsx | 2 +- src/pages/mypage/index.tsx | 2 +- src/pages/mypage/notice/index.tsx | 2 +- src/pages/mypage/question/index.tsx | 2 +- src/pages/mypage/withdraw/index.tsx | 2 +- src/pages/notification/index.tsx | 4 ++-- src/pages/reservation/[meetingRoomId].tsx | 7 +++--- src/pages/reservation/index.tsx | 1 - .../reservation/myreservationlist/index.tsx | 2 +- src/pages/sign/findpassword/index.tsx | 6 ++--- src/pages/signin/index.tsx | 2 +- src/pages/signup/index.tsx | 14 ++++------- 38 files changed, 47 insertions(+), 77 deletions(-) rename src/components/{ => layout}/footer/Footer.tsx (100%) rename src/components/{ => layout}/header/Header.tsx (100%) rename src/components/{ => layout}/header/ReservationHeader.tsx (100%) rename src/components/{ => sign}/backarrow/BackArrow.tsx (100%) rename src/components/{ => sign}/findpassword/ChangePasswordDone.tsx (95%) rename src/components/{ => sign}/findpassword/EmailCertification.tsx (99%) rename src/components/{ => sign}/findpassword/NewPasswordForm.tsx (100%) rename src/components/{ => sign}/findpassword/SetNewPasswod.tsx (91%) rename src/components/{ => sign}/signin/SigninForm.tsx (85%) rename src/components/{ => sign}/signup/EmailVerification.tsx (98%) rename src/components/{ => sign}/signup/JobPosition.tsx (100%) rename src/components/{ => sign}/signup/JobPositionItem.tsx (100%) rename src/components/{ => sign}/signup/PasswordVerification.tsx (99%) rename src/components/{ => sign}/signup/PhoneCertification.tsx (99%) rename src/components/{ => sign}/signup/SignupDone.tsx (95%) rename src/components/{ => sign}/signup/Terms.tsx (100%) rename src/components/{ => sign}/signup/terms/TermsItem.tsx (100%) rename src/components/{ => sign}/signup/terms/TermsModal.tsx (100%) rename src/components/{ => sign}/signup/terms/TermsTitle.tsx (100%) diff --git a/src/api/auth/auth.post.api.ts b/src/api/auth/auth.post.api.ts index 5f1106a..3b08f17 100644 --- a/src/api/auth/auth.post.api.ts +++ b/src/api/auth/auth.post.api.ts @@ -40,7 +40,7 @@ export const signin = async ({ email, password }: ISignIn) => { email, password }); - + console.log('실행1'); return response; }; diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index 5a0ffcc..684bdc7 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -1,10 +1,10 @@ import Head from 'next/head'; import { ReactNode } from 'react'; -import Footer from '@components/footer/Footer'; -import Header from '@/components/header/Header'; import { usePathname } from 'next/navigation'; import deleteFirstWord from '@/utils/deleteFirtstWord'; -import ReservationHeader from '../header/ReservationHeader'; +import ReservationHeader from './header/ReservationHeader'; +import Header from './header/Header'; +import Footer from './footer/Footer'; interface LayoutProps { title?: string; diff --git a/src/components/footer/Footer.tsx b/src/components/layout/footer/Footer.tsx similarity index 100% rename from src/components/footer/Footer.tsx rename to src/components/layout/footer/Footer.tsx diff --git a/src/components/header/Header.tsx b/src/components/layout/header/Header.tsx similarity index 100% rename from src/components/header/Header.tsx rename to src/components/layout/header/Header.tsx diff --git a/src/components/header/ReservationHeader.tsx b/src/components/layout/header/ReservationHeader.tsx similarity index 100% rename from src/components/header/ReservationHeader.tsx rename to src/components/layout/header/ReservationHeader.tsx diff --git a/src/components/backarrow/BackArrow.tsx b/src/components/sign/backarrow/BackArrow.tsx similarity index 100% rename from src/components/backarrow/BackArrow.tsx rename to src/components/sign/backarrow/BackArrow.tsx diff --git a/src/components/findpassword/ChangePasswordDone.tsx b/src/components/sign/findpassword/ChangePasswordDone.tsx similarity index 95% rename from src/components/findpassword/ChangePasswordDone.tsx rename to src/components/sign/findpassword/ChangePasswordDone.tsx index 20dc265..2492285 100644 --- a/src/components/findpassword/ChangePasswordDone.tsx +++ b/src/components/sign/findpassword/ChangePasswordDone.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import MainContainer from '../shared/MainContainer'; import { useRouter } from 'next/router'; +import MainContainer from '@/components/shared/MainContainer'; const ChangePasswordDone = () => { const router = useRouter(); diff --git a/src/components/findpassword/EmailCertification.tsx b/src/components/sign/findpassword/EmailCertification.tsx similarity index 99% rename from src/components/findpassword/EmailCertification.tsx rename to src/components/sign/findpassword/EmailCertification.tsx index 6b9749c..403857a 100644 --- a/src/components/findpassword/EmailCertification.tsx +++ b/src/components/sign/findpassword/EmailCertification.tsx @@ -1,11 +1,11 @@ import React, { ChangeEvent, Dispatch, useEffect, useRef, useState } from 'react'; -import ToBack from '../shared/sign/ToBack'; import { SignupBtnStatus } from '@/models/signupBtnStatus'; import { motion } from 'framer-motion'; import { useMutation } from 'react-query'; import { invertSecond } from '@/utils/invertSecond'; import { emailauthrequest, emailauthverify } from '@/api/auth/auth.post.api'; import { signError } from '@/constant/signError'; +import ToBack from '@/components/shared/sign/ToBack'; interface EmailCertificationProps { setStep: Dispatch>; diff --git a/src/components/findpassword/NewPasswordForm.tsx b/src/components/sign/findpassword/NewPasswordForm.tsx similarity index 100% rename from src/components/findpassword/NewPasswordForm.tsx rename to src/components/sign/findpassword/NewPasswordForm.tsx diff --git a/src/components/findpassword/SetNewPasswod.tsx b/src/components/sign/findpassword/SetNewPasswod.tsx similarity index 91% rename from src/components/findpassword/SetNewPasswod.tsx rename to src/components/sign/findpassword/SetNewPasswod.tsx index 836f034..69ef4f3 100644 --- a/src/components/findpassword/SetNewPasswod.tsx +++ b/src/components/sign/findpassword/SetNewPasswod.tsx @@ -1,6 +1,6 @@ import React, { Dispatch } from 'react'; -import ToBack from '../shared/sign/ToBack'; import NewPasswordForm from './NewPasswordForm'; +import ToBack from '@/components/shared/sign/ToBack'; const SetNewPassword = ({ setStep diff --git a/src/components/signin/SigninForm.tsx b/src/components/sign/signin/SigninForm.tsx similarity index 85% rename from src/components/signin/SigninForm.tsx rename to src/components/sign/signin/SigninForm.tsx index e3cc207..84da495 100644 --- a/src/components/signin/SigninForm.tsx +++ b/src/components/sign/signin/SigninForm.tsx @@ -2,33 +2,21 @@ import React, { useEffect, useState } from 'react'; import { useForm } from 'react-hook-form'; import useLogin from '@/hook/useLogin'; import { ISignIn } from '@/api/types/auth'; -import { signinmock } from '@/api/mock.api'; -// interface SigninType { -// email: string; -// password: string; -// } const SigninForm = () => { const [isError, setIsError] = useState(false); const { register, handleSubmit, - // setError, formState: { errors } } = useForm(); - useEffect(() => { - signinmock(); - }, []); - const { mutate, error } = useLogin(); const FormSubmit = async (data: ISignIn) => { setIsError(false); const { email, password } = data; mutate({ email, password }); - //todo : signin 처리 - console.log(data); }; useEffect(() => { @@ -41,14 +29,6 @@ const SigninForm = () => { return () => clearTimeout(timeoutId); }, [isError]); - // { - // error.length > 2 - // ? setError('password', { - // type: 'manual', - // message: '*일치하지 않습니다.' - // }) - // : null; - // } return (
FormSubmit(data))} @@ -106,10 +86,6 @@ const SigninForm = () => { void; diff --git a/src/components/signup/JobPosition.tsx b/src/components/sign/signup/JobPosition.tsx similarity index 100% rename from src/components/signup/JobPosition.tsx rename to src/components/sign/signup/JobPosition.tsx diff --git a/src/components/signup/JobPositionItem.tsx b/src/components/sign/signup/JobPositionItem.tsx similarity index 100% rename from src/components/signup/JobPositionItem.tsx rename to src/components/sign/signup/JobPositionItem.tsx diff --git a/src/components/signup/PasswordVerification.tsx b/src/components/sign/signup/PasswordVerification.tsx similarity index 99% rename from src/components/signup/PasswordVerification.tsx rename to src/components/sign/signup/PasswordVerification.tsx index 4344e74..e7a5b62 100644 --- a/src/components/signup/PasswordVerification.tsx +++ b/src/components/sign/signup/PasswordVerification.tsx @@ -1,11 +1,11 @@ import React, { SetStateAction, useEffect, useState } from 'react'; -import ToBack from '../shared/sign/ToBack'; import Image from 'next/image'; import { ApplyValues } from '@/models/applyValues'; import dynamic from 'next/dynamic'; import Terms from './Terms'; import { JobPositionType } from '@/models/jobPosition'; import { jobPosition } from '@/constant/jobPosition'; +import ToBack from '@/components/shared/sign/ToBack'; /* eslint-disable no-unused-vars */ const JobPosition = dynamic(() => import('./JobPosition'), { ssr: false diff --git a/src/components/signup/PhoneCertification.tsx b/src/components/sign/signup/PhoneCertification.tsx similarity index 99% rename from src/components/signup/PhoneCertification.tsx rename to src/components/sign/signup/PhoneCertification.tsx index 5de7554..3d5272b 100644 --- a/src/components/signup/PhoneCertification.tsx +++ b/src/components/sign/signup/PhoneCertification.tsx @@ -1,5 +1,4 @@ import React, { ChangeEvent, useEffect, useRef, useState } from 'react'; -import ToBack from '../shared/sign/ToBack'; import { SignupBtnStatus } from '@/models/signupBtnStatus'; import { motion } from 'framer-motion'; import { invertSecond } from '@/utils/invertSecond'; @@ -7,6 +6,8 @@ import { useMutation } from 'react-query'; import { phoneauthrequest, phoneauthverify } from '@/api/auth/auth.post.api'; import { ApplyValues } from '@/models/applyValues'; import { signError } from '@/constant/signError'; +import ToBack from '@/components/shared/sign/ToBack'; + /* eslint-disable no-unused-vars */ interface PhoneCertificationProps { onNext: (phoneNumber: ApplyValues['memberPhone']) => void; diff --git a/src/components/signup/SignupDone.tsx b/src/components/sign/signup/SignupDone.tsx similarity index 95% rename from src/components/signup/SignupDone.tsx rename to src/components/sign/signup/SignupDone.tsx index cf8c1a0..13e9f74 100644 --- a/src/components/signup/SignupDone.tsx +++ b/src/components/sign/signup/SignupDone.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import MainContainer from '../shared/MainContainer'; import { useRouter } from 'next/router'; +import MainContainer from '@/components/shared/MainContainer'; const SignupDone = () => { const router = useRouter(); diff --git a/src/components/signup/Terms.tsx b/src/components/sign/signup/Terms.tsx similarity index 100% rename from src/components/signup/Terms.tsx rename to src/components/sign/signup/Terms.tsx diff --git a/src/components/signup/terms/TermsItem.tsx b/src/components/sign/signup/terms/TermsItem.tsx similarity index 100% rename from src/components/signup/terms/TermsItem.tsx rename to src/components/sign/signup/terms/TermsItem.tsx diff --git a/src/components/signup/terms/TermsModal.tsx b/src/components/sign/signup/terms/TermsModal.tsx similarity index 100% rename from src/components/signup/terms/TermsModal.tsx rename to src/components/sign/signup/terms/TermsModal.tsx diff --git a/src/components/signup/terms/TermsTitle.tsx b/src/components/sign/signup/terms/TermsTitle.tsx similarity index 100% rename from src/components/signup/terms/TermsTitle.tsx rename to src/components/sign/signup/terms/TermsTitle.tsx diff --git a/src/hook/useLogin.ts b/src/hook/useLogin.ts index 49cbbfe..e3441a7 100644 --- a/src/hook/useLogin.ts +++ b/src/hook/useLogin.ts @@ -4,8 +4,9 @@ import { setCookie } from '@/utils/cookies'; import { useRouter } from 'next/navigation'; import { useMutation } from '@tanstack/react-query'; import { useState } from 'react'; -import { getTokenHandler } from '@/components/pwa/Fcm'; -import { fcmpost } from '@/api/fcm/fcm.post.api'; +//todo 기범님 오류 +// import { getTokenHandler } from '@/components/pwa/Fcm'; +// import { fcmpost } from '@/api/fcm/fcm.post.api'; const useLogin = () => { const router = useRouter(); @@ -14,18 +15,17 @@ const useLogin = () => { const onSuccess = async (data: UserLoginType) => { const { accessToken } = data.data; const cookieOptions = { path: '/', maxAge: 600000 * 15 }; - const token = await getTokenHandler(); - fcmpost({ fcmToken: token }); + // const token = await getTokenHandler(); + // fcmpost({ fcmToken: token }); setCookie('token', accessToken, cookieOptions); - router.push('/'); - console.log(token); }; - const onError = () => { - console.log('error'); + + const onError = (error: any) => { setError('*아이디 혹은 비밀번호가 일치하지 않습니다'); console.log(error); }; + const { mutate } = useMutation({ mutationFn: signin, onSuccess, diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 879b28e..167d6b8 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { userinfo } from '@/api/auth/auth.get.api'; -import Footer from '@/components/footer/Footer'; import MainPageIndex from '@/components/home/MainPageIndex'; +import Footer from '@/components/layout/footer/Footer'; import MainContainer from '@/components/shared/MainContainer'; import { useMember, useSetMember } from '@/store/user'; import React, { useEffect } from 'react'; diff --git a/src/pages/map/index.tsx b/src/pages/map/index.tsx index 8b7942a..08f6d95 100644 --- a/src/pages/map/index.tsx +++ b/src/pages/map/index.tsx @@ -1,6 +1,6 @@ import MainContainer from '@/components/shared/MainContainer'; import UseMap from '@/components/map/UseMap'; -import Footer from '@/components/footer/Footer'; +import Footer from '@/components/layout/footer/Footer'; const MapPage = () => { return ( @@ -8,7 +8,7 @@ const MapPage = () => {
-
+
diff --git a/src/pages/mypage/changepassword/index.tsx b/src/pages/mypage/changepassword/index.tsx index df1edeb..b73af70 100644 --- a/src/pages/mypage/changepassword/index.tsx +++ b/src/pages/mypage/changepassword/index.tsx @@ -1,11 +1,11 @@ import React, { useState } from 'react'; import { useForm } from 'react-hook-form'; -// import Link from 'next/link'; import { passwordverify } from '@/api/auth/auth.post.api'; import { useMutation } from '@tanstack/react-query'; import { changepassword } from '@/api/auth/auth.patch.api'; import { useRouter } from 'next/navigation'; -import { BackArrow } from '@/components/backarrow/BackArrow'; +import { BackArrow } from '@/components/sign/backarrow/BackArrow'; + export default function PasswordChange() { const { register, diff --git a/src/pages/mypage/changeprofile/index.tsx b/src/pages/mypage/changeprofile/index.tsx index b184fc0..3372926 100644 --- a/src/pages/mypage/changeprofile/index.tsx +++ b/src/pages/mypage/changeprofile/index.tsx @@ -2,9 +2,9 @@ import React, { useState } from 'react'; import Link from 'next/link'; import { useMember } from '@/store/user'; import { getTitleFromDescription, jobPosition } from '@/constant/jobPosition'; -import { BackArrow } from '@/components/backarrow/BackArrow'; import { memberimage } from '@/api/auth/auth.patch.api'; import useUpdateMember from '@/hook/useUpdateMember'; +import { BackArrow } from '@/components/sign/backarrow/BackArrow'; // import { useQuery } from 'react-query'; // Uncomment when useQuery is available export default function Profile() { diff --git a/src/pages/mypage/guide/index.tsx b/src/pages/mypage/guide/index.tsx index 62efa3d..762f4f5 100644 --- a/src/pages/mypage/guide/index.tsx +++ b/src/pages/mypage/guide/index.tsx @@ -1,4 +1,4 @@ -import { BackArrow } from '@/components/backarrow/BackArrow'; +import { BackArrow } from '@/components/sign/backarrow/BackArrow'; import React from 'react'; const GuidePage = () => { diff --git a/src/pages/mypage/index.tsx b/src/pages/mypage/index.tsx index 99bfe61..91a664e 100644 --- a/src/pages/mypage/index.tsx +++ b/src/pages/mypage/index.tsx @@ -5,8 +5,8 @@ import LogoutModal from '@/components/modal/logoutModal'; import { useState } from 'react'; import useLoggedOut from '@/hook/useLoggedOut'; import SuccessModal from '@/components/modal/successModal'; -import Footer from '@/components/footer/Footer'; import useUpdateMember from '@/hook/useUpdateMember'; +import Footer from '@/components/layout/footer/Footer'; const MyPage = () => { const member = useMember(); diff --git a/src/pages/mypage/notice/index.tsx b/src/pages/mypage/notice/index.tsx index 7e11a35..68250ac 100644 --- a/src/pages/mypage/notice/index.tsx +++ b/src/pages/mypage/notice/index.tsx @@ -1,5 +1,5 @@ -import { BackArrow } from '@/components/backarrow/BackArrow'; import MainContainer from '@/components/shared/MainContainer'; +import { BackArrow } from '@/components/sign/backarrow/BackArrow'; import React, { useState } from 'react'; const NoticePage = () => { diff --git a/src/pages/mypage/question/index.tsx b/src/pages/mypage/question/index.tsx index 211ebd4..fd4b9e5 100644 --- a/src/pages/mypage/question/index.tsx +++ b/src/pages/mypage/question/index.tsx @@ -1,5 +1,5 @@ import { questiongetmock, questionpostmock } from '@/api/mock.api'; -import { BackArrow } from '@/components/backarrow/BackArrow'; +import { BackArrow } from '@/components/sign/backarrow/BackArrow'; import { useQuery } from '@tanstack/react-query'; import React, { useState } from 'react'; diff --git a/src/pages/mypage/withdraw/index.tsx b/src/pages/mypage/withdraw/index.tsx index 6d069b4..cf83a20 100644 --- a/src/pages/mypage/withdraw/index.tsx +++ b/src/pages/mypage/withdraw/index.tsx @@ -1,6 +1,6 @@ import { del } from '@/api/auth/auth.delete.api'; -import { BackArrow } from '@/components/backarrow/BackArrow'; import MainContainer from '@/components/shared/MainContainer'; +import { BackArrow } from '@/components/sign/backarrow/BackArrow'; import { useState } from 'react'; const MemberWithdrawal = () => { diff --git a/src/pages/notification/index.tsx b/src/pages/notification/index.tsx index a5e24cc..0b5c6f5 100644 --- a/src/pages/notification/index.tsx +++ b/src/pages/notification/index.tsx @@ -1,5 +1,3 @@ -import { BackArrow } from '@/components/backarrow/BackArrow'; -import Footer from '@/components/footer/Footer'; import { Fragment } from 'react'; import useNoticeGet from '@/components/community/hooks/useNoticeGet'; import { NotificationType } from '@/api/types/notification'; @@ -10,6 +8,8 @@ import { useNotificationCategory, useSetNotificationCategory } from '@/store/notifications.store'; +import Footer from '@/components/layout/footer/Footer'; +import { BackArrow } from '@/components/sign/backarrow/BackArrow'; const categorizeNotifications = (notifications: NotificationType[]) => { const today = new Date(); diff --git a/src/pages/reservation/[meetingRoomId].tsx b/src/pages/reservation/[meetingRoomId].tsx index 851ec31..82faa19 100644 --- a/src/pages/reservation/[meetingRoomId].tsx +++ b/src/pages/reservation/[meetingRoomId].tsx @@ -1,13 +1,12 @@ import MainContainer from '@/components/shared/MainContainer'; import MeetingRoomInfo from '@/components/reservation/meetingRoom/MeetingRoomInfo'; -import Footer from '@/components/footer/Footer'; +import Footer from '@/components/layout/footer/Footer'; const MeetingRoomDetailPage = () => { - return ( - -