Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion blog/google-icon-update/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import TabItem from '@theme/TabItem';
import ZoomImage from '@site/src/components/ZoomImage';
import imgGsuite from './assets/03-google-old-gsuite-logo.png';
import imgWorkspace from './assets/06-googleworkspace-new-logo.png';
import imgXPost from './assets/10-x-post.png';

<!-- truncate -->

Expand Down Expand Up @@ -146,7 +147,9 @@ The people who are happy are mostly the ones who experienced the confusion probl
Looking at the new icons directly, here is what stands out:

<BrowserWindow url="https://x.com/Gautamk104/status/2057843133392842780?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E2057843133392842780%7Ctwgr%5E3dbaf20e8e4f9f64fd6032e85f7ed7c1e1b5fe0f%7Ctwcon%5Es1_c10&ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Furl%3Dhttps%3A%2F%2Ftwitter.com%2FGautamk104%2Fstatus%2F2057843133392842780" bodyStyle={{padding: 0}}>
[![Github](./assets/10-x-post.png)](https://x.com/Gautamk104/status/2057843133392842780?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E2057843133392842780%7Ctwgr%5E3dbaf20e8e4f9f64fd6032e85f7ed7c1e1b5fe0f%7Ctwcon%5Es1_c10&ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Furl%3Dhttps%3A%2F%2Ftwitter.com%2FGautamk104%2Fstatus%2F2057843133392842780)
<a href="https://x.com/Gautamk104/status/2057843133392842780?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E2057843133392842780%7Ctwgr%5E3dbaf20e8e4f9f64fd6032e85f7ed7c1e1b5fe0f%7Ctwcon%5Es1_c10&ref_url=https%3A%2F%2Fpublish.twitter.com%2F%3Furl%3Dhttps%3A%2F%2Ftwitter.com%2FGautamk104%2Fstatus%2F2057843133392842780">
<img src={imgXPost} alt="X post about the Google Workspace icon update" />
</a>
</BrowserWindow>


Expand Down
2 changes: 1 addition & 1 deletion src/components/BlogSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default function BlogSearch({ initialSearchTerm = "", onSearchSubmit }: B
<div className="blog-search-section">
<h4 className="blog-search-section-title">MATCHING ARTICLES</h4>
<div className="blog-search-articles">
{searchResults.articles.map((article, idx) => {
{searchResults.articles.map((article) => {
const itemIndex = selectableItems.findIndex((item) => item.label === article.title);
return (
<Link
Expand Down
2 changes: 1 addition & 1 deletion src/components/Community/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { type FC, useEffect, useState, useMemo } from "react";
import React, { type FC, useMemo } from "react";
import SlotCounter from "react-slot-counter";
import "./LandingCommunity.css";
import { useCommunityStatsContext } from "@site/src/lib/statsProvider";
Expand Down
20 changes: 0 additions & 20 deletions src/components/FloatingContributors/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -439,26 +439,6 @@ const FloatingContributors: React.FC<FloatingContributorsProps> = ({
}
};

// Get icon for action type
const getActionIcon = (action: ContributorActivity["action"]): string => {
switch (action) {
case "pushed":
return "🚀";
case "created":
return "✨";
case "merged":
return "🔄";
case "opened":
return "📝";
case "commented":
return "💬";
case "closed":
return "✅";
default:
return "💻";
}
};

// Get text for action type
const getActionText = (action: ContributorActivity["action"]): string => {
switch (action) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/blogCarousel/blogCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function BlogCarousel() {
>
<BlogCard
type={blog.category}
date={(blog as any).date}
date={blog.date}
title={blog.title}
content={blog.description}
imageUrl={blog.image}
Expand Down Expand Up @@ -119,4 +119,4 @@ export function BlogCarousel() {
</Carousel>
</div>
);
}
}
83 changes: 2 additions & 81 deletions src/components/dashboard/LeaderBoard/leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { mockContributors } from "./mockData";
import "./leaderboard.css";

const GITHUB_ORG = "recodehive";
type TimeFilter = "week" | "month" | "year" | "all";

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

interface Stats {
flooredTotalPRs: number;
totalContributors: number;
flooredTotalPoints: number;
}

// Badge configuration - maps badge numbers to achievement criteria
const BADGE_CONFIG = [
{
Expand Down Expand Up @@ -212,63 +207,6 @@ function Badge({
);
}

function TopPerformerCard({
contributor,
rank,
onPRClick,
onBadgeClick,
}: {
contributor: Contributor;
rank: number;
onPRClick: (contributor: Contributor) => void;
onBadgeClick?: (contributor: Contributor) => void;
}) {
const { isDark } = useSafeColorMode();
const rankClass = rank === 1 ? "top-1" : rank === 2 ? "top-2" : "top-3";
const badges = getContributorBadges(contributor, rank);

return (
<div className={`top-performer-card ${isDark ? "dark" : "light"}`}>
<img
src={contributor.avatar}
alt={contributor.username}
className="avatar large"
/>
<div className={`rank-overlay ${rankClass}`}>
<span className="rank-text">{rank}</span>
</div>
<div className="performer-info">
<a
href={contributor.profile}
target="_blank"
rel="noreferrer"
className="username-link"
>
{contributor.username}
</a>
<ContributorBadges
badges={badges}
onClick={() => onBadgeClick?.(contributor)}
/>
<div className="badges-container">
<Badge
count={contributor.prs}
label="PRs"
color={{ background: "#dbeafe", color: "#2563eb" }}
onClick={() => onPRClick(contributor)}
clickable={true}
/>
<Badge
count={contributor.points}
label="Points"
color={{ background: "#ede9fe", color: "#7c3aed" }}
/>
</div>
</div>
</div>
);
}

export default function LeaderBoard(): JSX.Element {
// Get time filter functions from context
const {
Expand Down Expand Up @@ -349,7 +287,6 @@ export default function LeaderBoard(): JSX.Element {

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

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

// Helper function for time filter display
const getTimeFilterLabel = (filter: string) => {
switch (filter) {
case "week":
return "📊 This Week";
case "month":
return "📆 This Month";
case "year":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these all are in use

return "📅 This Year";
case "all":
return "🏆 All Time";
default:
return "🏆 All Time";
}
};

return (
<div className={`leaderboard-container ${isDark ? "dark" : "light"}`}>
<div className="leaderboard-content">
Expand Down Expand Up @@ -498,7 +419,7 @@ export default function LeaderBoard(): JSX.Element {
value={currentTimeFilter}
onChange={(e) => {
// Use setTimeFilter from context
setTimeFilter(e.target.value as any);
setTimeFilter(e.target.value as TimeFilter);
setCurrentPage(1);
setIsSelectChanged(true);
setTimeout(() => setIsSelectChanged(false), 1200);
Expand Down
2 changes: 1 addition & 1 deletion src/components/faqs/faqs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const faqData = [

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

const toggleAccordion = (index: number) => {
setActiveIndex(activeIndex === index ? null : index);
Expand Down
4 changes: 2 additions & 2 deletions src/components/navbar/NavbarIconInjector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect } from "react";
import { createRoot } from "react-dom/client";
import { createRoot, type Root } from "react-dom/client";
import NavbarIcon from "./NavbarIcon";
import {
NAVBAR_ICONS,
Expand All @@ -8,7 +8,7 @@ import {

export default function NavbarIconInjector() {
useEffect(() => {
const roots = new Map<string, any>();
const roots = new Map<string, Root>();

NAVBAR_ICONS.forEach((name: NavbarIconName) => {
const id = `nav-${name.toLowerCase()}`;
Expand Down
4 changes: 1 addition & 3 deletions src/components/ourProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export interface Props {
const ShowcasePage: React.FC<Props> = ({
Data: legacyData,
}) => {
const { colorMode, isDark } = useSafeColorMode();
const { isDark } = useSafeColorMode();

// Use JSON data by default, fallback to legacy props for backward compatibility
// Convert legacy data to new format if needed
Expand Down Expand Up @@ -169,8 +169,6 @@ const SelectComponent = ({
isDark: boolean;
}) => {
const [activeItem, setActiveItem] = useState(0);
const [isHovered, setIsHovered] = useState(false);

return (
<motion.div
initial={{ opacity: 0, y: 20 }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/testimonials/TestimonialCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react";
import React from "react";
import { motion } from "framer-motion";
import { Quote } from "lucide-react";
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
Expand Down
5 changes: 1 addition & 4 deletions src/components/topmate/TopMateCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
const { isDark } = useSafeColorMode();

const borderClr = isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.07)";
const mutedClr = isDark
? "rgba(148,163,184,0.55)"
: "rgba(100,116,139,0.65)";
const subtleClr = isDark
? "rgba(148,163,184,0.35)"
: "rgba(100,116,139,0.45)";
Expand Down Expand Up @@ -324,4 +321,4 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
);
};

export default TopMateCard;
export default TopMateCard;
1 change: 1 addition & 0 deletions src/database/blogs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface Blog {
authors: string[];
category: string;
tags?: string[];
date?: string;
}

const blogs: Blog[] = [
Expand Down
18 changes: 11 additions & 7 deletions src/lib/statsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, {
useState,
type ReactNode,
} from "react";
import { githubService, type GitHubOrgStats } from "../services/githubService";
import { githubService } from "../services/githubService";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";

// Time filter types
Expand Down Expand Up @@ -78,6 +78,11 @@ interface PullRequestItem {
labels?: Array<{ name: string }>;
}

interface OrgRepository {
name: string;
archived: boolean;
}

// Enhanced contributor type for internal processing (stores all PRs)
interface FullContributor extends Omit<Contributor, "points" | "prs"> {
allPRDetails: PRDetails[]; // All PRs regardless of filter
Expand All @@ -94,7 +99,6 @@ interface CommunityStatsProviderProps {
}

const GITHUB_ORG = "recodehive";
const POINTS_PER_PR = 10;
const MAX_CONCURRENT_REQUESTS = 15;
const CACHE_DURATION = 20 * 60 * 1000; // 20 minutes cache
const MAX_PAGES_PER_REPO = 10;
Expand Down Expand Up @@ -253,7 +257,7 @@ export function CommunityStatsProvider({

const fetchAllOrgRepos = useCallback(
async (headers: Record<string, string>) => {
const repos: any[] = [];
const repos: OrgRepository[] = [];
let page = 1;
while (true) {
const resp = await fetch(
Expand All @@ -267,7 +271,7 @@ export function CommunityStatsProvider({
`Failed to fetch org repos: ${resp.status} ${resp.statusText}`,
);
}
const data = await resp.json();
const data: OrgRepository[] = await resp.json();
repos.push(...data);
if (!Array.isArray(data) || data.length < 100) break;
page++;
Expand Down Expand Up @@ -337,7 +341,7 @@ export function CommunityStatsProvider({
// Enhanced processing function that stores only valid PRs with points
const processBatch = useCallback(
async (
repos: any[],
repos: OrgRepository[],
headers: Record<string, string>,
): Promise<{
contributorMap: Map<string, FullContributor>;
Expand Down Expand Up @@ -479,8 +483,8 @@ export function CommunityStatsProvider({
},
timestamp: now,
});
} catch (err: any) {
if (err.name !== "AbortError") {
} catch (err: unknown) {
if (!(err instanceof DOMException && err.name === "AbortError")) {
console.error("Error fetching GitHub organization stats:", err);
setError(
err instanceof Error ? err.message : "Failed to fetch GitHub stats",
Expand Down
1 change: 0 additions & 1 deletion src/pages/License/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import "./index.css";

const Licensing: React.FC = () => {
Expand Down
19 changes: 2 additions & 17 deletions src/pages/badges/github-badges.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React, { useEffect, useState } from "react";
import Head from "@docusaurus/Head";
import { motion, HTMLMotionProps } from "framer-motion";
import type { ReactElement } from "react";
import { motion } from "framer-motion";
import Layout from "@theme/Layout";
import { useColorMode } from "@docusaurus/theme-common";
import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";

// Safe hook for color mode that handles SSR
Expand Down Expand Up @@ -34,13 +32,8 @@ function useSafeColorMode() {
}
import styles from "./github-badges.module.css";

type MotionDivProps = HTMLMotionProps<"div">;
type MotionTrProps = HTMLMotionProps<"tr">;

import Link from "@docusaurus/Link";

const GithubBadgesContent = (): React.ReactElement => {
const { colorMode, isDark, mounted } = useSafeColorMode();
const { isDark } = useSafeColorMode();

// Scroll to top button logic
useEffect(() => {
Expand All @@ -66,10 +59,6 @@ const GithubBadgesContent = (): React.ReactElement => {
return () => window.removeEventListener("scroll", handleScroll);
}, []);

const handleScrollToTop = () => {
window.scrollTo({ top: 0, behavior: "smooth" });
};

return (
<Layout
title="GitHub Achievements Guide - recode hive"
Expand Down Expand Up @@ -1355,10 +1344,6 @@ const GithubBadgesContent = (): React.ReactElement => {
);
};

const handleScrollToTop = () => {
window.scrollTo({ top: 0, behavior: "smooth" });
};

const GithubBadges = (): React.ReactElement => {
return <GithubBadgesContent />;
};
Expand Down
Loading
Loading