From 35d212a270d2b3e213ac68d77639b27d61fa4848 Mon Sep 17 00:00:00 2001 From: doSeung11 Date: Tue, 11 Jun 2024 09:00:04 +0900 Subject: [PATCH] fix bug --- src/pages/product/ProductListPage.tsx | 49 ++++++++++++++------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/pages/product/ProductListPage.tsx b/src/pages/product/ProductListPage.tsx index 3c2fdf7..43890f0 100644 --- a/src/pages/product/ProductListPage.tsx +++ b/src/pages/product/ProductListPage.tsx @@ -127,13 +127,6 @@ export const ProductListPage = () => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [goalId, user.jwt]); - if ( - goalProduct && - goalProduct.products.recommendedProducts.length === 0 && - loading - ) - return ; - return ( <> @@ -157,26 +150,34 @@ export const ProductListPage = () => { ☝️ - {goalProduct?.products.enrolledProducts.length != 0 ? ( + {goalProduct && + goalProduct.products.recommendedProducts.length === 0 && + loading ? ( + + ) : ( <> -
- 이미 가입된 적금 - - {" "} - {goalProduct?.products.enrolledProducts.length} - - 개가 존재합니다. + {goalProduct?.products.enrolledProducts.length != 0 ? ( + <> +
+ 이미 가입된 적금 + + {" "} + {goalProduct?.products.enrolledProducts.length} + + 개가 존재합니다. +
+ + ) : null} + +
+ {goalProduct?.products.recommendedProducts.map( + (product: recommendedProducts) => ( + + ) + )}
- ) : null} - -
- {goalProduct?.products.recommendedProducts.map( - (product: recommendedProducts) => ( - - ) - )} -
+ )}
);