Skip to content

Commit 962859c

Browse files
Aprasaksclaude
andcommitted
fix: React 에러 및 Tailwind V4 코드 품질 개선 (#38)
- topic-container: Math.random() 제거 → 최신 3개 고정 (LCP 안정화) - ChatBot: useEffect deps에 onHighlight 추가 - CategoryFilter: max-w-[6rem] → max-w-24 - hero-section: min-h-[420px] → min-h-105, rounded-[2.5rem] → rounded-5xl - page.tsx: h-[420px] → h-105 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2c90101 commit 962859c

5 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function Home() {
1414
<HeroSection />
1515
</section>
1616

17-
<aside className="md:col-span-5 h-[420px]">
17+
<aside className="md:col-span-5 h-105">
1818
<TopicContainer />
1919
</aside>
2020
</div>

src/components/archive/CategoryFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default function CategoryFilter({
7171
<button
7272
onClick={() => setSeriesOpen((v) => !v)}
7373
className={[
74-
'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 max-w-[6rem] sm:max-w-none truncate',
74+
'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 max-w-24 sm:max-w-none truncate',
7575
seriesOpen || selectedSeries
7676
? 'border-zinc-900 bg-zinc-900 text-white dark:border-white dark:bg-white dark:text-zinc-900'
7777
: 'border-zinc-300 text-zinc-500 hover:text-zinc-900 dark:border-zinc-600 dark:hover:text-zinc-100',

src/components/archive/ChatBot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function ChatBot({ onHighlight, lang }: ChatBotProps) {
5252
useEffect(() => {
5353
setMessages([createMessage('assistant', GREETING[lang] ?? GREETING.ko)]);
5454
onHighlight([]);
55-
}, [lang]);
55+
}, [lang, onHighlight]);
5656

5757
const bottomRef = useRef<HTMLDivElement>(null);
5858

src/components/home/hero-section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Image from 'next/image';
33

44
export default function HeroSection() {
55
return (
6-
<div className="relative overflow-hidden rounded-[2.5rem] border border-white/10 bg-zinc-950/20 px-10 py-14 transition-all hover:border-white/20 hover:shadow-2xl md:px-12 md:py-16 min-h-[420px]">
6+
<div className="relative overflow-hidden rounded-5xl border border-white/10 bg-zinc-950/20 px-10 py-14 transition-all hover:border-white/20 hover:shadow-2xl md:px-12 md:py-16 min-h-105">
77
<div className="pointer-events-none absolute inset-0 z-0 opacity-80 select-none">
88
<Image
99
src="/images/coded-library.webp"

src/components/home/topic-container.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import { getAllPosts } from '@/lib/posts';
55
export default function TopicContainer() {
66
const posts = getAllPosts('ko');
77

8-
const featured = [...posts]
9-
.sort(() => Math.random() - 0.5)
10-
.slice(0, 3);
8+
const featured = posts.slice(0, 3);
119

1210
return (
1311
<div className="flex h-full flex-col gap-3">

0 commit comments

Comments
 (0)