Skip to content

Commit 33834e5

Browse files
Aprasaksclaude
andcommitted
fix: 모바일 반응형 개선 및 누락 요소 수정 (#36)
- CategoryFilter: 모바일 2줄 레이아웃, 언어 토글 KO/EN 축약 - PostHeader: 날짜 표시 추가 - SeriesNav: lang 기반 다국어 처리 (이전편/다음편 → Prev/Next) - ArchiveClient: img → Next.js Image 교체 - archive/logs slug 페이지: overflow-x-hidden 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 32e70d8 commit 33834e5

6 files changed

Lines changed: 26 additions & 19 deletions

File tree

src/app/archive/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default async function PostPage({ params, searchParams }: PageProps) {
6868
const next = currentIndex < seriesPosts.length - 1 ? seriesPosts[currentIndex + 1] : null;
6969

7070
return (
71-
<main className="mx-auto max-w-3xl px-4 sm:px-6 py-12 min-h-[calc(100vh-64px-56px)]">
71+
<main className="mx-auto max-w-3xl px-4 sm:px-6 py-12 min-h-[calc(100vh-64px-56px)] overflow-x-hidden">
7272
{/* JSON-LD 구조화 데이터 */}
7373
<script
7474
type="application/ld+json"

src/app/logs/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default async function LogPage({ params }: PageProps) {
4646
if (!log) notFound();
4747

4848
return (
49-
<main className="mx-auto max-w-3xl px-4 sm:px-6 py-12 min-h-[calc(100vh-64px-56px)]">
49+
<main className="mx-auto max-w-3xl px-4 sm:px-6 py-12 min-h-[calc(100vh-64px-56px)] overflow-x-hidden">
5050
{/* JSON-LD */}
5151
<script
5252
type="application/ld+json"

src/components/archive/ArchiveClient.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client';
22

33
import { useState, useEffect } from 'react';
4+
import Image from 'next/image';
45
import type { Post, Category, PostLang, Series } from '@/types/archive';
56
import PostGrid from './PostGrid';
67
import ChatBot from './ChatBot';
@@ -85,7 +86,7 @@ export default function ArchiveClient({
8586
onClick={() => setMobileChat(true)}
8687
className="md:hidden fixed bottom-6 left-1/2 -translate-x-1/2 z-40 flex items-center gap-2 rounded-full bg-zinc-900 border border-white/20 px-5 py-3 text-sm font-medium text-zinc-100 shadow-xl hover:bg-zinc-800 transition-colors cursor-pointer"
8788
>
88-
<img src="/images/emoticon-small.png" alt="해고리" className="w-6 h-6 object-contain" />
89+
<Image src="/images/emoticon-small.png" alt="해고리" width={24} height={24} className="object-contain" />
8990
<span>사서에게 도움요청하기</span>
9091
</button>
9192
)}

src/components/archive/CategoryFilter.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,33 +47,35 @@ export default function CategoryFilter({
4747
};
4848

4949
return (
50-
<nav className="flex items-center gap-2">
51-
<div className="flex flex-1 flex-wrap items-center gap-2">
50+
<nav className="flex flex-col gap-2 sm:flex-row sm:items-center">
51+
{/* 카테고리 */}
52+
<div className="flex flex-1 flex-wrap items-center gap-1.5">
5253
{categories.map((cat) => (
5354
<button
5455
key={cat.id}
5556
onClick={() => onChange(cat.id)}
5657
className={[
57-
'cursor-pointer rounded-full px-4 py-1.5 text-sm font-medium transition-colors',
58+
'cursor-pointer rounded-full px-3 py-1 text-xs sm:px-4 sm:py-1.5 sm:text-sm font-medium transition-colors',
5859
selected === cat.id
5960
? 'bg-zinc-900 text-white dark:bg-white dark:text-zinc-900'
6061
: 'text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100',
6162
].join(' ')}
6263
>
6364
{cat.label}
64-
<span className="ml-1.5 text-xs opacity-60">{cat.count}</span>
65+
<span className="ml-1 text-xs opacity-60">{cat.count}</span>
6566
</button>
6667
))}
6768
</div>
6869

70+
{/* 시리즈 + 언어 토글 */}
6971
<div className="flex shrink-0 items-center gap-2">
7072
{/* 시리즈 드롭다운 */}
7173
{series.length > 0 && (
7274
<div ref={dropdownRef} className="relative">
7375
<button
7476
onClick={() => setSeriesOpen((v) => !v)}
7577
className={[
76-
'cursor-pointer rounded-full border px-3.5 py-1.5 text-sm font-medium transition-colors',
78+
'cursor-pointer rounded-full border px-3 py-1 text-xs sm:px-3.5 sm:py-1.5 sm:text-sm font-medium transition-colors',
7779
seriesOpen || selectedSeries
7880
? 'border-zinc-900 bg-zinc-900 text-white dark:border-white dark:bg-white dark:text-zinc-900'
7981
: 'border-zinc-300 text-zinc-500 hover:text-zinc-900 dark:border-zinc-600 dark:hover:text-zinc-100',
@@ -108,31 +110,30 @@ export default function CategoryFilter({
108110
)}
109111

110112
{/* 언어 토글 */}
111-
<div className="flex items-center overflow-hidden rounded-full border border-zinc-300 text-sm font-medium dark:border-zinc-600">
113+
<div className="flex items-center overflow-hidden rounded-full border border-zinc-300 text-xs sm:text-sm font-medium dark:border-zinc-600">
112114
<button
113115
onClick={() => onLangChange('ko')}
114116
className={[
115-
'cursor-pointer px-3 py-1.5 transition-colors',
117+
'cursor-pointer px-2.5 py-1 sm:px-3 sm:py-1.5 transition-colors',
116118
lang === 'ko'
117119
? 'bg-zinc-900 text-white dark:bg-white dark:text-zinc-900'
118120
: 'text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-300',
119121
].join(' ')}
120122
>
121-
한국어
123+
<span className="sm:hidden">KO</span>
124+
<span className="hidden sm:inline">한국어</span>
122125
</button>
123-
<span className="text-zinc-300 select-none dark:text-zinc-600">
124-
/
125-
</span>
126+
<span className="text-zinc-300 select-none dark:text-zinc-600">/</span>
126127
<button
127128
onClick={() => onLangChange('en')}
128129
className={[
129-
'cursor-pointer px-3 py-1.5 transition-colors',
130+
'cursor-pointer px-2.5 py-1 sm:px-3 sm:py-1.5 transition-colors',
130131
lang === 'en'
131132
? 'bg-zinc-900 text-white dark:bg-white dark:text-zinc-900'
132133
: 'text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-300',
133134
].join(' ')}
134135
>
135-
English
136+
EN
136137
</button>
137138
</div>
138139
</div>

src/components/archive/PostHeader.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ export default function PostHeader({ post }: PostHeaderProps) {
4646
</p>
4747
)}
4848

49+
{/* 날짜 */}
50+
<time dateTime={post.date} className="mt-4 block text-xs text-zinc-600 tabular-nums">
51+
{post.date}
52+
</time>
53+
4954
<div className="mt-6 border-b border-zinc-800" />
5055
</header>
5156
);

src/components/archive/SeriesNav.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function SeriesNav({ prev, next, lang }: SeriesNavProps) {
1313
return (
1414
<nav className="mt-16 border-t border-white/10 pt-8">
1515
<p className="mb-4 text-xs font-medium tracking-widest text-zinc-500 uppercase">
16-
Series
16+
{lang === 'ko' ? '시리즈' : 'Series'}
1717
</p>
1818
<div className="grid grid-cols-2 gap-4">
1919
{/* 이전 편 */}
@@ -23,7 +23,7 @@ export default function SeriesNav({ prev, next, lang }: SeriesNavProps) {
2323
href={`/archive/${prev.slug}?lang=${lang}`}
2424
className="group flex flex-col gap-1 rounded-xl border border-white/10 bg-white/5 p-4 transition-colors hover:border-white/20 hover:bg-white/10"
2525
>
26-
<span className="text-xs text-zinc-500">← 이전 편</span>
26+
<span className="text-xs text-zinc-500">{lang === 'ko' ? '← 이전 편' : '← Prev'}</span>
2727
<span className="text-sm font-medium text-zinc-200 line-clamp-2 group-hover:text-white transition-colors">
2828
{prev.title}
2929
</span>
@@ -40,7 +40,7 @@ export default function SeriesNav({ prev, next, lang }: SeriesNavProps) {
4040
href={`/archive/${next.slug}?lang=${lang}`}
4141
className="group flex flex-col gap-1 rounded-xl border border-white/10 bg-white/5 p-4 text-right transition-colors hover:border-white/20 hover:bg-white/10"
4242
>
43-
<span className="text-xs text-zinc-500">다음 편 →</span>
43+
<span className="text-xs text-zinc-500">{lang === 'ko' ? '다음 편 →' : 'Next →'}</span>
4444
<span className="text-sm font-medium text-zinc-200 line-clamp-2 group-hover:text-white transition-colors">
4545
{next.title}
4646
</span>

0 commit comments

Comments
 (0)