Skip to content

Commit 9c48f7f

Browse files
benthecoderclaude
andcommitted
fix eslint warnings and image styling issues
- replace <img> with Next.js <Image> component in Timeline and about page for better performance and LCP - add eslint-disable comments for valid useEffect dependency exceptions in search and HackerNews components - remove border/outline from hover images by adding !important overrides to .image-hover class fixes all build warnings while maintaining existing functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent baa4dc6 commit 9c48f7f

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

app/about/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react";
2+
import Image from "next/image";
23
import Timeline from "@/components/Timeline";
34

45
type ImageOnHoverProps = {
@@ -18,7 +19,13 @@ const ImageOnHover: React.FC<ImageOnHoverProps> = ({
1819
{text}
1920
</span>
2021
<div className="absolute hidden group-hover:flex left-1/2 -translate-x-1/2 bottom-full pb-2 z-50 pointer-events-none">
21-
<img src={imagePath} alt={altText} className="image-hover" />
22+
<Image
23+
src={imagePath}
24+
alt={altText}
25+
className="image-hover"
26+
width={300}
27+
height={200}
28+
/>
2229
</div>
2330
</span>
2431
);

app/globals.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ mark {
299299
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
300300
animation: fadeInImage 200ms ease-out;
301301
transform-origin: center;
302+
border: none !important;
303+
outline: none !important;
302304
}
303305

304306
.dark .image-hover {

app/search/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ function SearchContent() {
125125
if (cached) setResults(JSON.parse(cached));
126126

127127
setHasSearched(sessionStorage.getItem("hasSearched") === "true");
128+
// eslint-disable-next-line react-hooks/exhaustive-deps
128129
}, []);
129130

130131
const handleSearch = async (e: React.FormEvent) => {
@@ -220,6 +221,7 @@ function SearchContent() {
220221
// Don't auto-trigger search when params change
221222
// Users must press Enter or click Search button
222223
}
224+
// eslint-disable-next-line react-hooks/exhaustive-deps
223225
}, [searchParams]);
224226

225227
// Clear hasSearched when query changes

components/HackerNews.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const HackerNews = () => {
4545

4646
useEffect(() => {
4747
fetchTopStories();
48+
// eslint-disable-next-line react-hooks/exhaustive-deps
4849
}, [currentPage]);
4950

5051
const handleNextPage = () => {

components/Timeline.tsx

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

33
import React, { useState, useRef } from "react";
4+
import Image from "next/image";
45

56
type ImageLink = {
67
text: string;
@@ -130,10 +131,12 @@ const Timeline: React.FC<TimelineProps> = ({ events }) => {
130131
left: `${position.left}px`,
131132
}}
132133
>
133-
<img
134+
<Image
134135
src={link.imagePath}
135136
alt={link.altText || link.text}
136137
className="image-hover"
138+
width={800}
139+
height={600}
137140
/>
138141
</div>
139142
)}

0 commit comments

Comments
 (0)