From 89c85cee19b5124104fd76745fde488e152e4827 Mon Sep 17 00:00:00 2001 From: Collection50 Date: Wed, 12 Jun 2024 17:55:55 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20nextjs=EC=9D=98=20Link=EB=A5=BC=20pr?= =?UTF-8?q?efetch=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MouseImageGallery/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/MouseImageGallery/index.tsx b/src/components/MouseImageGallery/index.tsx index d2220b3..97ddbc1 100644 --- a/src/components/MouseImageGallery/index.tsx +++ b/src/components/MouseImageGallery/index.tsx @@ -103,7 +103,11 @@ export default function MouseImageGallery() { - + From f8330427eab317a8e11fdb153f79600b3cf8ea46 Mon Sep 17 00:00:00 2001 From: Collection50 Date: Wed, 12 Jun 2024 17:57:53 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=EA=B0=9C=EC=9D=B8=20=EB=B8=94?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=ED=99=88=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EC=9D=98=20albums,=20stories,=20boarder=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/blog/[blogId]/components/Albums/Slider.tsx | 11 ++++++++++- src/app/blog/[blogId]/components/Albums/index.tsx | 12 +++--------- .../blog/[blogId]/components/BlogFetcher/types.ts | 2 +- src/app/blog/[blogId]/components/Board/index.tsx | 11 +++++++---- src/app/blog/[blogId]/components/StoryBox/index.tsx | 9 +++++---- src/app/blog/[blogId]/page.tsx | 2 ++ 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/app/blog/[blogId]/components/Albums/Slider.tsx b/src/app/blog/[blogId]/components/Albums/Slider.tsx index 6554186..b3d8957 100644 --- a/src/app/blog/[blogId]/components/Albums/Slider.tsx +++ b/src/app/blog/[blogId]/components/Albums/Slider.tsx @@ -5,8 +5,15 @@ import Image from 'next/image'; import { Button } from '@/components/Common'; import { generateId } from '@/utils'; import { useSlider } from './useSlider'; +import { useBlogPageContext } from '../BlogFetcher/BlogContext'; + +export default function Slider() { + const { postItems } = useBlogPageContext(); + + const photos = postItems.flatMap(({ photoUrl }) => + photoUrl ? photoUrl.filter(Boolean) : [], + ); -export default function Slider({ photos }: { photos: string[] }) { const { currentIndex, nextSlide, prevSlide } = useSlider(photos.length); const photoCount = photos.length; const slideWidth = 100 / photoCount; @@ -30,11 +37,13 @@ export default function Slider({ photos }: { photos: string[] }) { src={photo} layout="fill" objectFit="cover" + className="rounded-10" /> ))} + {photoCount > 5 && (
+
- {postItems.map(({ preview, title }) => ( - + {postItems.map((postItem) => ( + ))}
diff --git a/src/app/blog/[blogId]/page.tsx b/src/app/blog/[blogId]/page.tsx index 614010e..bf90bf8 100644 --- a/src/app/blog/[blogId]/page.tsx +++ b/src/app/blog/[blogId]/page.tsx @@ -30,6 +30,7 @@ export default function Page() { +
@@ -40,6 +41,7 @@ export default function Page() { )} +