From 882393f9099bec429cde619fc59c49b8d04deb03 Mon Sep 17 00:00:00 2001 From: AlinaRyabova Date: Thu, 22 Jan 2026 10:56:52 +0200 Subject: [PATCH 1/2] fix:Update leaderboard: fixed background --- .../leaderboard/LeaderboardClient.tsx | 45 ++++++++----------- .../leaderboard/LeaderboardTable.tsx | 8 ++-- frontend/components/leaderboard/types.ts | 6 +++ 3 files changed, 27 insertions(+), 32 deletions(-) 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..92c9df53 100644 --- a/frontend/components/leaderboard/types.ts +++ b/frontend/components/leaderboard/types.ts @@ -6,3 +6,9 @@ export interface User { avatar: string; change: number; } + +export interface CurrentUser { + id: string; + username: string; + email: string; +} \ No newline at end of file From 7618c2c008db382baa81377d2c59727e0df0bc3b Mon Sep 17 00:00:00 2001 From: AlinaRyabova Date: Thu, 22 Jan 2026 11:09:57 +0200 Subject: [PATCH 2/2] fix: remove email from CurrentUser type to prevent PII exposure --- frontend/components/leaderboard/types.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/components/leaderboard/types.ts b/frontend/components/leaderboard/types.ts index 92c9df53..ce0d77c6 100644 --- a/frontend/components/leaderboard/types.ts +++ b/frontend/components/leaderboard/types.ts @@ -10,5 +10,4 @@ export interface User { export interface CurrentUser { id: string; username: string; - email: string; } \ No newline at end of file