diff --git a/frontend/components/leaderboard/LeaderboardClient.tsx b/frontend/components/leaderboard/LeaderboardClient.tsx index 37e5c31f..b92a74ab 100644 --- a/frontend/components/leaderboard/LeaderboardClient.tsx +++ b/frontend/components/leaderboard/LeaderboardClient.tsx @@ -3,16 +3,15 @@ import { useRef } from 'react'; import { motion, useMotionTemplate, useMotionValue } from 'framer-motion'; import { useTranslations } from 'next-intl'; +import { cn } from '@/lib/utils'; import { LeaderboardPodium } from './LeaderboardPodium'; import { LeaderboardTable } from './LeaderboardTable'; -import { User } from './types'; +import { User, CurrentUser } from './types'; -// Імпортуємо тип з auth -type AuthUser = { id: string; username: string; email: string }; interface LeaderboardClientProps { initialUsers: User[]; - currentUser?: AuthUser | null; + currentUser?: CurrentUser | null; } export default function LeaderboardClient({ @@ -21,13 +20,10 @@ export default function LeaderboardClient({ }: LeaderboardClientProps) { const t = useTranslations('leaderboard'); - // Використовуємо всіх користувачів для таблиці const allUsers = initialUsers; - // Подіум тільки для тих, хто має бали const topThree = allUsers.filter(u => u.points > 0).slice(0, 3); const hasResults = topThree.length > 0; - // --- Логіка ефекту ліхтарика --- const containerRef = useRef(null); const mouseX = useMotionValue(0); const mouseY = useMotionValue(0); @@ -37,9 +33,8 @@ export default function LeaderboardClient({ clientX, clientY, }: React.MouseEvent) { - const { left, top } = currentTarget.getBoundingClientRect(); - mouseX.set(clientX - left); - mouseY.set(clientY - top); + mouseX.set(clientX); + mouseY.set(clientY); } const maskImage = useMotionTemplate`radial-gradient(500px circle at ${mouseX}px ${mouseY}px, black, transparent)`; @@ -48,41 +43,37 @@ export default function LeaderboardClient({
- {/* Background Layers - КОНТУРНІ СЕРДЕЧКА 💖 */} - - {/* 1. Статичний шар (сірі контури, ледь помітні) */}
- {/* 2. Динамічний шар (МАЖЕНТО контури, світяться під мишкою) */} - {/* Велика розмита пляма по центру */} -
+
-

+

{t('title')}

+

{t('subtitle')}

@@ -112,4 +103,4 @@ export default function LeaderboardClient({
); -} +} \ No newline at end of file diff --git a/frontend/components/leaderboard/LeaderboardTable.tsx b/frontend/components/leaderboard/LeaderboardTable.tsx index 15ceb8ea..1fee6820 100644 --- a/frontend/components/leaderboard/LeaderboardTable.tsx +++ b/frontend/components/leaderboard/LeaderboardTable.tsx @@ -4,13 +4,11 @@ import { TrendingUp, Trophy, Medal } from 'lucide-react'; import { motion } from 'framer-motion'; import { useTranslations } from 'next-intl'; import { cn } from '@/lib/utils'; -import { User } from './types'; - -type AuthUser = { id: string; username: string; email: string }; +import { User, CurrentUser } from './types'; interface LeaderboardTableProps { users: User[]; - currentUser?: AuthUser | null; + currentUser?: CurrentUser | null; } export function LeaderboardTable({ @@ -227,4 +225,4 @@ function RankBadge({ rank }: { rank: number }) { {rank} ); -} +} \ No newline at end of file diff --git a/frontend/components/leaderboard/types.ts b/frontend/components/leaderboard/types.ts index 3afd323a..ce0d77c6 100644 --- a/frontend/components/leaderboard/types.ts +++ b/frontend/components/leaderboard/types.ts @@ -6,3 +6,8 @@ export interface User { avatar: string; change: number; } + +export interface CurrentUser { + id: string; + username: string; +} \ No newline at end of file