Skip to content

Commit e6bb670

Browse files
fix: resolve TypeScript ESLint warnings
1 parent 5d224fc commit e6bb670

31 files changed

Lines changed: 102 additions & 206 deletions

File tree

src/components/BlogSearch/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default function BlogSearch({ initialSearchTerm = "", onSearchSubmit }: B
192192
<div className="blog-search-section">
193193
<h4 className="blog-search-section-title">MATCHING ARTICLES</h4>
194194
<div className="blog-search-articles">
195-
{searchResults.articles.map((article, idx) => {
195+
{searchResults.articles.map((article) => {
196196
const itemIndex = selectableItems.findIndex((item) => item.label === article.title);
197197
return (
198198
<Link

src/components/Community/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { type FC, useEffect, useState, useMemo } from "react";
1+
import React, { type FC, useMemo } from "react";
22
import SlotCounter from "react-slot-counter";
33
import "./LandingCommunity.css";
44
import { useCommunityStatsContext } from "@site/src/lib/statsProvider";

src/components/FloatingContributors/index.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -439,26 +439,6 @@ const FloatingContributors: React.FC<FloatingContributorsProps> = ({
439439
}
440440
};
441441

442-
// Get icon for action type
443-
const getActionIcon = (action: ContributorActivity["action"]): string => {
444-
switch (action) {
445-
case "pushed":
446-
return "🚀";
447-
case "created":
448-
return "✨";
449-
case "merged":
450-
return "🔄";
451-
case "opened":
452-
return "📝";
453-
case "commented":
454-
return "💬";
455-
case "closed":
456-
return "✅";
457-
default:
458-
return "💻";
459-
}
460-
};
461-
462442
// Get text for action type
463443
const getActionText = (action: ContributorActivity["action"]): string => {
464444
switch (action) {

src/components/blogCarousel/blogCarousel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function BlogCarousel() {
8282
>
8383
<BlogCard
8484
type={blog.category}
85-
date={(blog as any).date}
85+
date={blog.date}
8686
title={blog.title}
8787
content={blog.description}
8888
imageUrl={blog.image}
@@ -119,4 +119,4 @@ export function BlogCarousel() {
119119
</Carousel>
120120
</div>
121121
);
122-
}
122+
}

src/components/dashboard/LeaderBoard/leaderboard.tsx

Lines changed: 2 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { mockContributors } from "./mockData";
1111
import "./leaderboard.css";
1212

1313
const GITHUB_ORG = "recodehive";
14+
type TimeFilter = "week" | "month" | "year" | "all";
1415

1516
// Users to exclude from the leaderboard
1617
const EXCLUDED_USERS = [
@@ -44,12 +45,6 @@ interface Contributor {
4445
badges?: string[]; // Array of badge image paths
4546
}
4647

47-
interface Stats {
48-
flooredTotalPRs: number;
49-
totalContributors: number;
50-
flooredTotalPoints: number;
51-
}
52-
5348
// Badge configuration - maps badge numbers to achievement criteria
5449
const BADGE_CONFIG = [
5550
{
@@ -212,63 +207,6 @@ function Badge({
212207
);
213208
}
214209

215-
function TopPerformerCard({
216-
contributor,
217-
rank,
218-
onPRClick,
219-
onBadgeClick,
220-
}: {
221-
contributor: Contributor;
222-
rank: number;
223-
onPRClick: (contributor: Contributor) => void;
224-
onBadgeClick?: (contributor: Contributor) => void;
225-
}) {
226-
const { isDark } = useSafeColorMode();
227-
const rankClass = rank === 1 ? "top-1" : rank === 2 ? "top-2" : "top-3";
228-
const badges = getContributorBadges(contributor, rank);
229-
230-
return (
231-
<div className={`top-performer-card ${isDark ? "dark" : "light"}`}>
232-
<img
233-
src={contributor.avatar}
234-
alt={contributor.username}
235-
className="avatar large"
236-
/>
237-
<div className={`rank-overlay ${rankClass}`}>
238-
<span className="rank-text">{rank}</span>
239-
</div>
240-
<div className="performer-info">
241-
<a
242-
href={contributor.profile}
243-
target="_blank"
244-
rel="noreferrer"
245-
className="username-link"
246-
>
247-
{contributor.username}
248-
</a>
249-
<ContributorBadges
250-
badges={badges}
251-
onClick={() => onBadgeClick?.(contributor)}
252-
/>
253-
<div className="badges-container">
254-
<Badge
255-
count={contributor.prs}
256-
label="PRs"
257-
color={{ background: "#dbeafe", color: "#2563eb" }}
258-
onClick={() => onPRClick(contributor)}
259-
clickable={true}
260-
/>
261-
<Badge
262-
count={contributor.points}
263-
label="Points"
264-
color={{ background: "#ede9fe", color: "#7c3aed" }}
265-
/>
266-
</div>
267-
</div>
268-
</div>
269-
);
270-
}
271-
272210
export default function LeaderBoard(): JSX.Element {
273211
// Get time filter functions from context
274212
const {
@@ -349,7 +287,6 @@ export default function LeaderBoard(): JSX.Element {
349287

350288
const renderPaginationButtons = () => {
351289
const pages = [];
352-
const maxVisibleButtons = 5; // Maximum number of page buttons to show directly
353290

354291
// Special case: if we have 7 or fewer pages, show all of them without ellipsis
355292
if (totalPages <= 7) {
@@ -448,22 +385,6 @@ export default function LeaderBoard(): JSX.Element {
448385
return "regular";
449386
};
450387

451-
// Helper function for time filter display
452-
const getTimeFilterLabel = (filter: string) => {
453-
switch (filter) {
454-
case "week":
455-
return "📊 This Week";
456-
case "month":
457-
return "📆 This Month";
458-
case "year":
459-
return "📅 This Year";
460-
case "all":
461-
return "🏆 All Time";
462-
default:
463-
return "🏆 All Time";
464-
}
465-
};
466-
467388
return (
468389
<div className={`leaderboard-container ${isDark ? "dark" : "light"}`}>
469390
<div className="leaderboard-content">
@@ -498,7 +419,7 @@ export default function LeaderBoard(): JSX.Element {
498419
value={currentTimeFilter}
499420
onChange={(e) => {
500421
// Use setTimeFilter from context
501-
setTimeFilter(e.target.value as any);
422+
setTimeFilter(e.target.value as TimeFilter);
502423
setCurrentPage(1);
503424
setIsSelectChanged(true);
504425
setTimeout(() => setIsSelectChanged(false), 1200);

src/components/faqs/faqs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const faqData = [
4444

4545
const FAQs: React.FC = () => {
4646
const [activeIndex, setActiveIndex] = useState<number | null>(null);
47-
const { colorMode, isDark } = useSafeColorMode();
47+
const { isDark } = useSafeColorMode();
4848

4949
const toggleAccordion = (index: number) => {
5050
setActiveIndex(activeIndex === index ? null : index);

src/components/navbar/NavbarIconInjector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect } from "react";
2-
import { createRoot } from "react-dom/client";
2+
import { createRoot, type Root } from "react-dom/client";
33
import NavbarIcon from "./NavbarIcon";
44
import {
55
NAVBAR_ICONS,
@@ -8,7 +8,7 @@ import {
88

99
export default function NavbarIconInjector() {
1010
useEffect(() => {
11-
const roots = new Map<string, any>();
11+
const roots = new Map<string, Root>();
1212

1313
NAVBAR_ICONS.forEach((name: NavbarIconName) => {
1414
const id = `nav-${name.toLowerCase()}`;

src/components/ourProjects.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export interface Props {
5050
const ShowcasePage: React.FC<Props> = ({
5151
Data: legacyData,
5252
}) => {
53-
const { colorMode, isDark } = useSafeColorMode();
53+
const { isDark } = useSafeColorMode();
5454

5555
// Use JSON data by default, fallback to legacy props for backward compatibility
5656
// Convert legacy data to new format if needed
@@ -169,8 +169,6 @@ const SelectComponent = ({
169169
isDark: boolean;
170170
}) => {
171171
const [activeItem, setActiveItem] = useState(0);
172-
const [isHovered, setIsHovered] = useState(false);
173-
174172
return (
175173
<motion.div
176174
initial={{ opacity: 0, y: 20 }}

src/components/testimonials/TestimonialCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from "react";
1+
import React from "react";
22
import { motion } from "framer-motion";
33
import { Quote } from "lucide-react";
44
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";

src/components/topmate/TopMateCard.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
3131
const { isDark } = useSafeColorMode();
3232

3333
const borderClr = isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.07)";
34-
const mutedClr = isDark
35-
? "rgba(148,163,184,0.55)"
36-
: "rgba(100,116,139,0.65)";
3734
const subtleClr = isDark
3835
? "rgba(148,163,184,0.35)"
3936
: "rgba(100,116,139,0.45)";
@@ -324,4 +321,4 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
324321
);
325322
};
326323

327-
export default TopMateCard;
324+
export default TopMateCard;

0 commit comments

Comments
 (0)