From df1aedcc1703514b66fe614b3cb83d4986e2ed98 Mon Sep 17 00:00:00 2001 From: JAEMOONLEE Date: Wed, 27 Sep 2023 11:33:20 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EB=A3=B8=EB=93=B1=EB=A1=9D=20step3=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EC=9D=B4=EB=8F=99=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/room/addRoom/step1.tsx | 8 ++++---- pages/room/addRoom/step2.tsx | 5 ++--- pages/room/addRoom/step3.tsx | 15 ++++++++------- pages/userInfo/myPostings.tsx | 3 --- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/pages/room/addRoom/step1.tsx b/pages/room/addRoom/step1.tsx index 87df9bd..370a202 100644 --- a/pages/room/addRoom/step1.tsx +++ b/pages/room/addRoom/step1.tsx @@ -9,11 +9,11 @@ import { Checkbox, Button, Input, + Calendar, } from '@/components/index.tsx'; import { FieldValues, SubmitHandler, useForm } from 'react-hook-form'; import { GuList, DongList } from '@/public/js/guDongList.ts'; import { Option } from '@/components/Select/Select'; -import Calendar from '@/components/Calendar/Calendar.tsx'; import Step2 from '@/pages/room/addRoom/step2.tsx' interface GuDong extends Option { @@ -22,7 +22,7 @@ interface GuDong extends Option { } export default function Step1() { - const { openModal, closeModal } = useModal(); + const { openModal } = useModal(); const filterTranslation = useTranslation('filter'); const { register, handleSubmit, watch } = useForm({ mode: 'onChange' }); const [buttonState, setButtonState] = useState('YES'); @@ -32,6 +32,7 @@ export default function Step1() { value: '', label: '', }); + const [dongValue, setDongValue] = useState({ gu: '', guLabel: '', @@ -296,7 +297,7 @@ export default function Step1() {
@@ -308,4 +309,3 @@ export default function Step1() { ); } - diff --git a/pages/room/addRoom/step2.tsx b/pages/room/addRoom/step2.tsx index 5948ebe..6c738cb 100644 --- a/pages/room/addRoom/step2.tsx +++ b/pages/room/addRoom/step2.tsx @@ -1,5 +1,4 @@ -import React, { useState, useEffect } from 'react'; -import Router, { useRouter } from 'next/router'; +import React, { useState } from 'react'; import { Stepper, Stepper2, @@ -16,7 +15,7 @@ interface Step2Props { } export default function Step2({ step1Data }: Step2Props) { - const { openModal, closeModal } = useModal(); + const { openModal } = useModal(); const { register, handleSubmit, watch, setValue } = useForm({ mode: 'onChange' }); const useButtonState = (initValue: string) => { diff --git a/pages/room/addRoom/step3.tsx b/pages/room/addRoom/step3.tsx index dde38e0..f21abfe 100644 --- a/pages/room/addRoom/step3.tsx +++ b/pages/room/addRoom/step3.tsx @@ -9,7 +9,7 @@ import { Upload } from '@/components/index.tsx'; import { FieldValues, SubmitHandler, useForm } from 'react-hook-form'; -import Router from 'next/router'; +import { useRouter } from 'next/router'; interface Step2Props { step1Data?: any; @@ -23,20 +23,21 @@ export default function Step3({ step1Data, step2Data }: Step2Props) { const { register, handleSubmit, watch } = useForm({ mode: 'onChange' }); const [imageList, setImageList] = useState([]); const [showComplete, setShowComplete] = useState(false); + const router = useRouter(); const onSubmit: SubmitHandler = (data) => { - console.log('step1 Data', step1Data); - console.log('step2 Data', step2Data); - console.log('step3 Data', data); - setShowComplete(true); }; - const callbackImageList = (_imageList: ImageListType) => { setImageList(_imageList); } const roomPostComplete = () => { - Router.push('/'); + try { + // 라우팅이 안되요,,,, const result = router.push('/'); + window.location.href= window.location.origin; + } catch(error) { + console.error('routingError', error); + } } return ( diff --git a/pages/userInfo/myPostings.tsx b/pages/userInfo/myPostings.tsx index 86fbf8c..fe54869 100644 --- a/pages/userInfo/myPostings.tsx +++ b/pages/userInfo/myPostings.tsx @@ -13,7 +13,6 @@ interface MyPostingProps { export default function MyPosting({ roomInfo }: MyPostingProps) { const { openModal } = useModal(); - const handleAddPosting = () => { openModal({ props: { @@ -57,14 +56,12 @@ export default function MyPosting({ roomInfo }: MyPostingProps) { * 룸이 있을 때 보여주는 Component (TODO : 구체화 해줘야함) */ const MyRooms = () => { - return (
호이호이
); }; - return ( (roomInfo || []).length === 0 ? : )