From 115dacb997f42dc9686636be50f52510571f2ed4 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Wed, 3 Jun 2026 03:20:07 +0700 Subject: [PATCH] style(frontend): refactor analytics components with sky palette, semantic tokens, and visual polish --- .../analytics/components/TopicList.tsx | 10 +++--- .../analytics/components/TrendChart.tsx | 8 ++++- .../analytics/components/UserTable.tsx | 2 +- .../analytics/components/ViolatorTable.tsx | 34 +++++++++++-------- .../frontend/src/features/analytics/index.tsx | 11 +++--- 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/services/frontend/src/features/analytics/components/TopicList.tsx b/services/frontend/src/features/analytics/components/TopicList.tsx index 906743c..d74d5f2 100644 --- a/services/frontend/src/features/analytics/components/TopicList.tsx +++ b/services/frontend/src/features/analytics/components/TopicList.tsx @@ -35,7 +35,7 @@ export function TopicList({ topics, loading }: TopicListProps) { - + Topik Trending @@ -44,11 +44,11 @@ export function TopicList({ topics, loading }: TopicListProps) { -
+
{topics.map((topic, i) => (
{i + 1} @@ -57,9 +57,9 @@ export function TopicList({ topics, loading }: TopicListProps) { {topic.topic}
-
+
diff --git a/services/frontend/src/features/analytics/components/TrendChart.tsx b/services/frontend/src/features/analytics/components/TrendChart.tsx index 2b62b40..a517151 100644 --- a/services/frontend/src/features/analytics/components/TrendChart.tsx +++ b/services/frontend/src/features/analytics/components/TrendChart.tsx @@ -68,7 +68,13 @@ export function TrendChart({ trend, loading }: TrendChartProps) { stopOpacity="0.02" /> - +
- + Pelanggar Terbanyak @@ -59,20 +59,28 @@ export function ViolatorTable({ users, loading }: ViolatorTableProps) { - + - + {users.map((user, i) => { const danger = dangerLabel(user.violation_score); return ( -
# User Flagged Skor
{i + 1} @@ -83,11 +91,11 @@ export function ViolatorTable({ users, loading }: ViolatorTableProps) { ) : ( -
+
{user.username.charAt(0).toUpperCase()}
)} @@ -102,20 +110,20 @@ export function ViolatorTable({ users, loading }: ViolatorTableProps) {
+ {user.flagged_count}
-
+
= 10 - ? "bg-gradient-to-r from-red-600 to-red-400" + ? "bg-gradient-to-r from-accent to-pink-400" : user.violation_score >= 5 - ? "bg-gradient-to-r from-amber-500 to-amber-400" - : "bg-gradient-to-r from-yellow-500 to-yellow-400", + ? "bg-gradient-to-r from-pink-400 to-pink-300" + : "bg-gradient-to-r from-pink-300 to-pink-200", )} style={{ width: `${(user.violation_score / maxScore) * 100}%`, @@ -138,8 +146,6 @@ export function ViolatorTable({ users, loading }: ViolatorTableProps) { ); } -import { cn } from "../../../shared/lib/utils"; - function LoadingBox() { return ( diff --git a/services/frontend/src/features/analytics/index.tsx b/services/frontend/src/features/analytics/index.tsx index e9f9d9a..4dff37a 100644 --- a/services/frontend/src/features/analytics/index.tsx +++ b/services/frontend/src/features/analytics/index.tsx @@ -1,5 +1,7 @@ -import { useState } from "react"; import { motion } from "framer-motion"; +import { useState } from "react"; +import { cardItem, cardStagger } from "../../shared/hooks/useFramerStagger"; +import { EmptyStateMascot } from "../../widgets/mascot/ChibiMascot"; import { ActivityChart } from "./components/ActivityChart"; import { ControlBar } from "./components/ControlBar"; import { Heatmap } from "./components/Heatmap"; @@ -9,8 +11,6 @@ import { TrendChart } from "./components/TrendChart"; import { UserTable } from "./components/UserTable"; import { ViolatorTable } from "./components/ViolatorTable"; import { useAnalytics } from "./hooks/useAnalytics"; -import { cardStagger, cardItem } from "../../shared/hooks/useFramerStagger"; -import { EmptyStateMascot } from "../../widgets/mascot/ChibiMascot"; interface AnalyticsPanelProps { guildId: string; @@ -54,7 +54,10 @@ export function AnalyticsPanel({ guildId, guildName }: AnalyticsPanelProps) { if (!guildId) { return ( - + ); }