diff --git a/src/actions/productDetail.ts b/src/actions/productDetail.ts index 50718f5c..7cd8f3d8 100644 --- a/src/actions/productDetail.ts +++ b/src/actions/productDetail.ts @@ -14,11 +14,17 @@ export const getProductDetail = async (productId: number): Promise = { + 'Content-Type': 'application/json', + }; + + if (accessToken) { + headers.Authorization = `Bearer ${accessToken}`; + } + const productDetail = await fetcher(`${BASE_URL}/${TEAM_ID}/products/${productId}`, { method: 'GET', - headers: { - Authorization: `Bearer ${accessToken}`, - }, + headers, next: { revalidate: 300, tags: [`products-${productId}`] }, }); return productDetail; diff --git a/src/actions/review/review.ts b/src/actions/review/review.ts index 09a88d8b..704fa4ef 100644 --- a/src/actions/review/review.ts +++ b/src/actions/review/review.ts @@ -17,14 +17,19 @@ export const getProductReviews = async ( const session = await auth(); const accessToken = session?.accessToken; + const headers: Record = { + 'Content-Type': 'application/json', + }; + + if (accessToken) { + headers.Authorization = `Bearer ${accessToken}`; + } + const productReviews: ReviewResponse = await fetcher( `${BASE_URL}/${TEAM_ID}/products/${productId}/reviews?order=${option}&cursor=${cursorId}`, { method: 'GET', - headers: { - Authorization: `Bearer ${accessToken}`, - 'Content-Type': 'application/json', - }, + headers, next: { revalidate: 300, tags: [`reviews`] }, cache: 'force-cache', }, diff --git a/src/app/_components/ProductPost/ProductForm.tsx b/src/app/_components/ProductPost/ProductForm.tsx index 14d828d5..ed9bc142 100644 --- a/src/app/_components/ProductPost/ProductForm.tsx +++ b/src/app/_components/ProductPost/ProductForm.tsx @@ -12,6 +12,7 @@ import FileInput from '@/components/common/FileInput'; import Input from '@/components/common/Input'; import Textbox from '@/components/common/Textbox'; import Button from '@/components/ui/Buttons'; +import { cn } from '@/lib/utils'; import { useModalStore } from '@/store/modalStore'; import { productSchema } from '@/types/product/productSchema'; import { ProductDetail, ProductFormValue } from '@/types/product/productType'; @@ -96,7 +97,7 @@ const ProductForm = ({ product, mode }: { product: ProductDetail; mode: 'create' /> diff --git a/src/app/products/[productId]/components/ReviewSection.tsx b/src/app/products/[productId]/components/ReviewSection.tsx index 30e5f90a..362a6c2c 100644 --- a/src/app/products/[productId]/components/ReviewSection.tsx +++ b/src/app/products/[productId]/components/ReviewSection.tsx @@ -28,7 +28,6 @@ const ReviewSection = ({ const { items: reviews, triggerRef, - hasMore, reset, } = useInfiniteScroll({ initialData: initialReviews, @@ -85,10 +84,6 @@ const ReviewSection = ({ )} */}
- - {!hasMore && reviews.length > 0 && ( -

모든 리뷰를 불러왔습니다.

- )} ); }; diff --git a/src/assets/icon/Icon-scrollTop.svg b/src/assets/icon/Icon-scrollTop.svg new file mode 100644 index 00000000..514de2c1 --- /dev/null +++ b/src/assets/icon/Icon-scrollTop.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/components/common/Footer/Footer.tsx b/src/components/common/Footer/Footer.tsx index 44116f42..d1bab7d1 100644 --- a/src/components/common/Footer/Footer.tsx +++ b/src/components/common/Footer/Footer.tsx @@ -25,7 +25,7 @@ const Footer = () => { if (hideFooter) return null; return ( -