From 9a4dfa19aacee095b1f3229fcced6c2bcaaa2c05 Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Sat, 25 Oct 2025 23:28:11 +0900 Subject: [PATCH 01/17] =?UTF-8?q?fix(globals.css):=20body=20=EC=8A=A4?= =?UTF-8?q?=ED=83=80=EC=9D=BC=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20overflow-?= =?UTF-8?q?x-hidden=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/globals.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/globals.css b/src/app/globals.css index e2e1866..95694c6 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -167,8 +167,12 @@ * { @apply border-border break-keep outline-ring/50; } + html, body { - @apply flex items-center justify-center bg-blog-gray-100 font-pretendard; + @apply overflow-x-hidden; + } + body { + @apply bg-blog-gray-100 font-pretendard; } } From a5e284e6c1126e249e517153ee5fb00fd33908b0 Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Sat, 25 Oct 2025 23:29:03 +0900 Subject: [PATCH 02/17] =?UTF-8?q?refactor(page.tsx):=20PostCard=20?= =?UTF-8?q?=EB=B0=8F=20Tabs=20=EC=A0=9C=EA=B1=B0,=20PostList=EB=A1=9C=20?= =?UTF-8?q?=EB=8C=80=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/page.tsx | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 28d1fa3..e1ab81d 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,25 +1,9 @@ import { getAllPosts } from '@/shared/lib'; -import { PostCard, Tabs } from '@/shared'; -import { Grid } from '@/widgets'; +import { PostList } from '@/widgets'; export default function Home() { const allPosts = getAllPosts(); - return ( -
- - - {allPosts.map((post) => ( - - ))} - -
- ); + return ; } From 3ea7888b58848200e3ed7e4332d6278cb350aefa Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Sat, 25 Oct 2025 23:29:27 +0900 Subject: [PATCH 03/17] =?UTF-8?q?feat(post):=20PostList=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20?= =?UTF-8?q?index=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/index.ts | 1 + src/widgets/post/PostList.tsx | 37 +++++++++++++++++++++++++++++++++++ src/widgets/post/index.ts | 1 + 3 files changed, 39 insertions(+) create mode 100644 src/widgets/post/PostList.tsx create mode 100644 src/widgets/post/index.ts diff --git a/src/widgets/index.ts b/src/widgets/index.ts index 6d0f6f7..893a7e6 100644 --- a/src/widgets/index.ts +++ b/src/widgets/index.ts @@ -1,2 +1,3 @@ export * from './layout'; export * from './grid'; +export * from './post'; diff --git a/src/widgets/post/PostList.tsx b/src/widgets/post/PostList.tsx new file mode 100644 index 0000000..c2d3736 --- /dev/null +++ b/src/widgets/post/PostList.tsx @@ -0,0 +1,37 @@ +'use client'; + +import { useState } from 'react'; + +import { MDXPostMeta } from '@/shared/types'; + +import { PostCard, Tabs } from '@/shared'; +import { Grid } from '@/widgets'; + +type PostListProps = { + posts: MDXPostMeta[]; +}; + +export const PostList = ({ posts }: PostListProps) => { + const [selectedCategory, setSelectedCategory] = useState(null); + + // 선택된 카테고리에 따라 게시글 필터링 + const filteredPosts = selectedCategory + ? posts.filter((post) => post.category === selectedCategory) + : posts; + + return ( +
+ + + {filteredPosts.map((post) => ( + + ))} + +
+ ); +}; diff --git a/src/widgets/post/index.ts b/src/widgets/post/index.ts new file mode 100644 index 0000000..ffa8d33 --- /dev/null +++ b/src/widgets/post/index.ts @@ -0,0 +1 @@ +export * from './PostList'; From f6a894c71f61eba38009d82e2ddb27767cc4aa7b Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Sat, 25 Oct 2025 23:30:02 +0900 Subject: [PATCH 04/17] =?UTF-8?q?refactor(Header):=20Header=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B5=AC=EC=A1=B0=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0=20=EB=B0=8F=20=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/features/layout/Header.tsx | 44 ++++++++++++------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/src/shared/components/features/layout/Header.tsx b/src/shared/components/features/layout/Header.tsx index 1e4a352..3300275 100644 --- a/src/shared/components/features/layout/Header.tsx +++ b/src/shared/components/features/layout/Header.tsx @@ -1,3 +1,4 @@ +import Image from 'next/image'; import Link from 'next/link'; import { Search, Sun } from 'lucide-react'; @@ -7,22 +8,35 @@ import { Input } from '../../ui'; export const Header = () => { return ( -
- -

Dobblog

- -
- - -
-
- -

About

+
+
+ +
+ Dobblog Logo +

+ Dobblog +

+
- +
+ + +
+
+ +

About

+ + +
); From 6c8aeb1717f54d1135e20e822baeb0e46e4e3f7c Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Sat, 25 Oct 2025 23:30:21 +0900 Subject: [PATCH 05/17] =?UTF-8?q?feat(tabs):=20=EA=B2=8C=EC=8B=9C=EA=B8=80?= =?UTF-8?q?=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC=20=EA=B8=B0=EB=B0=98=20?= =?UTF-8?q?=ED=83=AD=20=EC=83=9D=EC=84=B1=20=EB=B0=8F=20=ED=95=84=ED=84=B0?= =?UTF-8?q?=EB=A7=81=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/components/features/tabs/Tabs.tsx | 71 ++++++++++++++------ 1 file changed, 51 insertions(+), 20 deletions(-) diff --git a/src/shared/components/features/tabs/Tabs.tsx b/src/shared/components/features/tabs/Tabs.tsx index 99fbf71..a4ab13e 100644 --- a/src/shared/components/features/tabs/Tabs.tsx +++ b/src/shared/components/features/tabs/Tabs.tsx @@ -2,32 +2,63 @@ import { useState } from 'react'; -export const Tabs = () => { +import { MDXPostMeta } from '@/shared/types'; + +type TabsProps = { + posts: MDXPostMeta[]; + onFilterChange: (category: string | null) => void; +}; + +export const Tabs = ({ posts, onFilterChange }: TabsProps) => { const [selected, setSelected] = useState(0); + // 게시글에서 카테고리 추출 및 카운트 + const getCategoryCounts = () => { + const categoryCounts: Record = {}; + + posts.forEach((post) => { + const category = post.category; + categoryCounts[category] = (categoryCounts[category] || 0) + 1; + }); + + return categoryCounts; + }; + + const categoryCounts = getCategoryCounts(); + + // All 탭 + 각 카테고리 탭 생성 const tabs = [ - { name: 'All.tsx', count: 49 }, - { name: 'Develop.tsx', count: 3 }, - { name: 'Daily.tsx', count: 9 }, - { name: 'Review.tsx', count: 4 }, + { name: 'All', count: posts.length, category: null }, + ...Object.entries(categoryCounts).map(([category, count]) => ({ + name: category, + count, + category, + })), ]; + const handleTabClick = (idx: number) => { + setSelected(idx); + onFilterChange(tabs[idx].category); + }; + return ( -
- {tabs.map((tab, idx) => ( -
setSelected(idx)} - > -

{tab.name}

-

({tab.count})

-
- ))} +
+
+ {tabs.map((tab, idx) => ( +
handleTabClick(idx)} + > +

{tab.name}

+

({tab.count})

+
+ ))} +
); }; From 055dda91f65520e7430e15fa55f308c76e90c727 Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Sat, 25 Oct 2025 23:43:26 +0900 Subject: [PATCH 06/17] =?UTF-8?q?fix(Footer):=20Footer=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0=20=EB=B0=8F=20=EB=B0=98=EC=9D=91=ED=98=95=20?= =?UTF-8?q?=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/components/features/layout/Footer.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/components/features/layout/Footer.tsx b/src/shared/components/features/layout/Footer.tsx index 5483d9f..f0b787b 100644 --- a/src/shared/components/features/layout/Footer.tsx +++ b/src/shared/components/features/layout/Footer.tsx @@ -2,16 +2,16 @@ import Link from 'next/link'; export const Footer = () => { return ( -