diff --git a/frontend/src/components/Recipe/RecipeRegisterForm/RecipeRegisterForm.tsx b/frontend/src/components/Recipe/RecipeRegisterForm/RecipeRegisterForm.tsx index 96f13fad4..4b15893a9 100644 --- a/frontend/src/components/Recipe/RecipeRegisterForm/RecipeRegisterForm.tsx +++ b/frontend/src/components/Recipe/RecipeRegisterForm/RecipeRegisterForm.tsx @@ -7,7 +7,7 @@ import RecipeNameInput from '../RecipeNameInput/RecipeNameInput'; import RecipeUsedProducts from '../RecipeUsedProducts/RecipeUsedProducts'; import { ImageUploader, SvgIcon } from '@/components/Common'; -import { useImageUploader, useFormData } from '@/hooks/common'; +import { useImageUploader, useFormData, useTimeout } from '@/hooks/common'; import { useRecipeFormValueContext, useRecipeFormActionContext } from '@/hooks/context'; import { useRecipeRegisterFormMutation } from '@/hooks/queries/recipe'; import type { RecipeRequest } from '@/types/recipe'; @@ -61,6 +61,8 @@ const RecipeRegisterForm = ({ closeRecipeDialog }: RecipeRegisterFormProps) => { }); }; + const [debouncedRecipeSubmit] = useTimeout(handleRecipeFormSubmit, 200); + return ( 나만의 꿀조합 만들기🍯 @@ -69,7 +71,7 @@ const RecipeRegisterForm = ({ closeRecipeDialog }: RecipeRegisterFormProps) => { -
+ diff --git a/frontend/src/components/Review/ReviewRegisterForm/ReviewRegisterForm.tsx b/frontend/src/components/Review/ReviewRegisterForm/ReviewRegisterForm.tsx index a75ea5ee6..f555d0314 100644 --- a/frontend/src/components/Review/ReviewRegisterForm/ReviewRegisterForm.tsx +++ b/frontend/src/components/Review/ReviewRegisterForm/ReviewRegisterForm.tsx @@ -10,7 +10,7 @@ import StarRate from '../StarRate/StarRate'; import { ImageUploader, SvgIcon } from '@/components/Common'; import { ProductOverviewItem } from '@/components/Product'; import { MIN_DISPLAYED_TAGS_LENGTH } from '@/constants'; -import { useFormData, useImageUploader, useScroll } from '@/hooks/common'; +import { useFormData, useImageUploader, useScroll, useTimeout } from '@/hooks/common'; import { useReviewFormActionContext, useReviewFormValueContext } from '@/hooks/context'; import { useProductDetailQuery } from '@/hooks/queries/product'; import { useReviewRegisterFormMutation } from '@/hooks/queries/review'; @@ -77,6 +77,8 @@ const ReviewRegisterForm = ({ productId, targetRef, closeReviewDialog, initTabMe }); }; + const [debouncedReviewSubmit] = useTimeout(handleSubmit, 200); + return ( 리뷰 작성 @@ -88,7 +90,7 @@ const ReviewRegisterForm = ({ productId, targetRef, closeReviewDialog, initTabMe - + 구매한 상품 사진이 있다면 올려주세요. @@ -110,7 +112,7 @@ const ReviewRegisterForm = ({ productId, targetRef, closeReviewDialog, initTabMe - [작성시 유의사항] 신뢰성 확보에 저해되는 게시물은 삭제하거나 보이지 않게 할 수 있습니다.{' '} + [작성시 유의사항] 신뢰성 확보에 저해되는 게시물은 삭제하거나 보이지 않게 할 수 있습니다.