+
{
>
주소
-
-
@@ -324,45 +417,11 @@ const SignupForm = () => {
}
const AddressModal = ({
- onSaveInSignup,
+ handleComplete,
}: {
- onSaveInSignup: (addressData: SignupData['address']) => void
+ handleComplete: (data: { jibunAddress: string; roadAddress: string }) => void
}) => {
- const { showModal, hideModal } = modalStore()
- const { mutate: addressToGeolocation } = useGetAddressToGeolocation()
- const { address } = useGetAddress()
- const { toast } = useToast()
-
- const handleComplete = async (data: { address: string }) => {
- addressToGeolocation(data.address, {
- onSuccess: (data) => {
- showModal({
- content: (
-
- ),
- })
- },
- onError: (error) => {
- console.log({ error })
- toast({
- title: '주소 검색에 실패했습니다.',
- description: '다시 시도해주세요.',
- variant: 'destructive',
- position: 'center',
- })
- },
- })
- }
+ const { hideModal } = modalStore()
const handleClose = () => {
hideModal()
@@ -370,11 +429,17 @@ const AddressModal = ({
return (
-
+
-
+
{
+ hideModal()
+ handleComplete(data)
+ }}
+ autoClose={true}
+ />
)
From a35b4b88c7b909c5fed4e14b72326dd6979b1ea8 Mon Sep 17 00:00:00 2001
From: Suhyeon Jeon
Date: Mon, 3 Mar 2025 22:57:00 +0900
Subject: [PATCH 9/9] =?UTF-8?q?fix:=20=EC=A3=BC=EC=86=8C=20=EC=97=B0?=
=?UTF-8?q?=EB=8F=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/mypage/address/_components/AddressOption.tsx | 2 ++
src/app/mypage/address/_components/AddressSearchModal.tsx | 4 ++--
src/app/mypage/address/detail/_components/MapInfo.tsx | 8 +++++++-
src/app/reviews/_components/Review.tsx | 4 ++--
4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/app/mypage/address/_components/AddressOption.tsx b/src/app/mypage/address/_components/AddressOption.tsx
index 2c3b7dc..44e70c1 100644
--- a/src/app/mypage/address/_components/AddressOption.tsx
+++ b/src/app/mypage/address/_components/AddressOption.tsx
@@ -41,6 +41,8 @@ const AddressOption = () => {
const queryClient = useQueryClient()
const handleComplete = async (data: { address: string }) => {
+ setPopup(false)
+
addressToGeolocation(data.address, {
onSuccess: (data) => {
showModal({
diff --git a/src/app/mypage/address/_components/AddressSearchModal.tsx b/src/app/mypage/address/_components/AddressSearchModal.tsx
index 3fa02d0..a413829 100644
--- a/src/app/mypage/address/_components/AddressSearchModal.tsx
+++ b/src/app/mypage/address/_components/AddressSearchModal.tsx
@@ -1,5 +1,5 @@
-import React, { ReactNode } from 'react'
import Icon from '@/components/Icon'
+import React, { ReactNode } from 'react'
interface ModalProps {
isOpen: boolean
@@ -12,7 +12,7 @@ const AddressSearchModal: React.FC = ({ isOpen, onClose, children })
return (
-
+
diff --git a/src/app/mypage/address/detail/_components/MapInfo.tsx b/src/app/mypage/address/detail/_components/MapInfo.tsx
index 4010f3c..6074c61 100644
--- a/src/app/mypage/address/detail/_components/MapInfo.tsx
+++ b/src/app/mypage/address/detail/_components/MapInfo.tsx
@@ -11,6 +11,7 @@ import { useToast } from '@/hooks/useToast'
import { cn } from '@/lib/utils'
import { SignupData } from '@/models/auth'
import { modalStore } from '@/store/modal'
+import memberStore from '@/store/user'
import { useQueryClient } from '@tanstack/react-query'
import { useEffect, useState } from 'react'
import { AddressData } from './AddressDetail'
@@ -30,6 +31,7 @@ const MapInfo = ({
const { toast } = useToast()
const { hideModal } = modalStore()
+ const { setMember } = memberStore()
const [addressDetail, setAddressDetail] = useState('')
const [alias, setAlias] = useState('')
@@ -98,7 +100,11 @@ const MapInfo = ({
const _options = {
onSuccess: () => {
- refetchMember()
+ refetchMember().then((res) => {
+ if (res.data) {
+ setMember(res.data)
+ }
+ })
queryClient.invalidateQueries({ queryKey: ['address'] })
hideModal()
},
diff --git a/src/app/reviews/_components/Review.tsx b/src/app/reviews/_components/Review.tsx
index 3d5e40c..52b930f 100644
--- a/src/app/reviews/_components/Review.tsx
+++ b/src/app/reviews/_components/Review.tsx
@@ -27,7 +27,7 @@ const Review = () => {
} = useInfiniteScroll
({
queryKey: 'completed-reviews',
endpoint: 'reviews',
- size: 2,
+ size: 10,
})
const handleChangeTab = (tab: ReviewTabType) => {
@@ -69,7 +69,7 @@ const Review = () => {
/>
))
) : (
-
+
)}