From 9642f2511a76de6a2b8dfe59ba7191de0e7fdd5f Mon Sep 17 00:00:00 2001 From: Pierre Ryssen Date: Wed, 11 Mar 2026 12:26:45 +0100 Subject: [PATCH] perf: change the DA to something more readable --- app/api/tiktok/stats/route.ts | 11 ++++++++++- app/dashboard/layout.tsx | 8 ++++---- app/dashboard/page.tsx | 6 +++--- app/finances/layout.tsx | 4 ++-- app/finances/page.tsx | 10 +++++----- app/globals.css | 2 +- app/instagram/layout.tsx | 4 ++-- app/instagram/page.tsx | 11 +++++------ app/layout.tsx | 2 +- app/page.tsx | 30 +++++++++++++++--------------- app/tiktok/layout.tsx | 4 ++-- app/tiktok/page.tsx | 30 +++++++++++++++--------------- app/twitch/layout.tsx | 4 ++-- app/twitch/page.tsx | 10 +++++----- app/youtube/layout.tsx | 4 ++-- app/youtube/page.tsx | 10 +++++----- components/LiveBanner.tsx | 18 +++++++++--------- components/LogFeed.tsx | 12 ++++++------ components/MemberList.tsx | 16 ++++++++-------- components/Sidebar.tsx | 28 +++++++++++++--------------- components/StatCard.tsx | 20 ++++++++++---------- tailwind.config.js | 12 +++++++++++- 22 files changed, 136 insertions(+), 120 deletions(-) diff --git a/app/api/tiktok/stats/route.ts b/app/api/tiktok/stats/route.ts index 09f9520..4b7cc1f 100644 --- a/app/api/tiktok/stats/route.ts +++ b/app/api/tiktok/stats/route.ts @@ -15,6 +15,16 @@ export async function GET() { return NextResponse.json({ error: "Session error" }, { status: 401 }); } + if (process.env.NODE_ENV === "development") { + return NextResponse.json({ + followers: 124, + likes: 856, + videoCount: 1, + displayName: "CrowMate studio", + avatarUrl: "", + }); + } + const tokenRecord = await prisma.tikTokToken.findUnique({ where: { userId } }); if (!tokenRecord) { @@ -23,7 +33,6 @@ export async function GET() { let { accessToken, refreshToken, openId, expiresAt } = tokenRecord; - // Refresh si expiré (avec 60s de marge) if (expiresAt.getTime() - Date.now() < 60_000) { try { const refreshed = await refreshAccessToken(refreshToken); diff --git a/app/dashboard/layout.tsx b/app/dashboard/layout.tsx index 20f67cc..7d0779a 100644 --- a/app/dashboard/layout.tsx +++ b/app/dashboard/layout.tsx @@ -17,8 +17,8 @@ export default function AuthLayout({ children }: { children: React.ReactNode }) if (status === "loading") { return ( -
- +
+ CHARGEMENT...
@@ -28,9 +28,9 @@ export default function AuthLayout({ children }: { children: React.ReactNode }) if (status !== "authenticated") return null; return ( -
+
-
+
{children}
diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index fc260af..093ad0e 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -1,9 +1,9 @@ export default function DashboardPage() { return (
-
Vue générale
-

Tableau de bord

-

Données à venir...

+
Vue générale
+

Tableau de bord

+

Données à venir...

); } \ No newline at end of file diff --git a/app/finances/layout.tsx b/app/finances/layout.tsx index 3383095..fe65f98 100644 --- a/app/finances/layout.tsx +++ b/app/finances/layout.tsx @@ -19,9 +19,9 @@ export default function AuthLayout({ children }: { children: React.ReactNode }) if (status !== "authenticated") return null; return ( -
+
-
+
{children}
diff --git a/app/finances/page.tsx b/app/finances/page.tsx index 881e66f..075f62f 100644 --- a/app/finances/page.tsx +++ b/app/finances/page.tsx @@ -5,11 +5,11 @@ export default function FinancesPage() { return (
-
+
-
Revenus
+
Revenus

Finances

@@ -21,9 +21,9 @@ export default function FinancesPage() {
-
- -

+

+ +

AUCUNE DONNÉE FINANCIÈRE DISPONIBLE
POUR LE MOMENT

diff --git a/app/globals.css b/app/globals.css index bc58bb4..26a3738 100644 --- a/app/globals.css +++ b/app/globals.css @@ -4,4 +4,4 @@ ::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-track { background: transparent; } -::-webkit-scrollbar-thumb { background: #1a2a1a; border-radius: 2px; } \ No newline at end of file +::-webkit-scrollbar-thumb { background: #30363d; border-radius: 2px; } diff --git a/app/instagram/layout.tsx b/app/instagram/layout.tsx index 3383095..fe65f98 100644 --- a/app/instagram/layout.tsx +++ b/app/instagram/layout.tsx @@ -19,9 +19,9 @@ export default function AuthLayout({ children }: { children: React.ReactNode }) if (status !== "authenticated") return null; return ( -
+
-
+
{children}
diff --git a/app/instagram/page.tsx b/app/instagram/page.tsx index f7d9a2f..34be773 100644 --- a/app/instagram/page.tsx +++ b/app/instagram/page.tsx @@ -1,4 +1,3 @@ - import StatCard from "@/components/StatCard"; import { Camera } from "lucide-react"; @@ -6,11 +5,11 @@ export default function InstagramPage() { return (
-
+
-
Plateforme
+
Plateforme

Instagram

@@ -22,9 +21,9 @@ export default function InstagramPage() {
-
- -

+

+ +

CONNECTEZ VOTRE COMPTE INSTAGRAM
POUR AFFICHER VOS STATISTIQUES

diff --git a/app/layout.tsx b/app/layout.tsx index e7933b6..39d73e8 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -10,7 +10,7 @@ export const metadata: Metadata = { export default function RootLayout({ children }: { children: React.ReactNode }) { return ( - + {children} diff --git a/app/page.tsx b/app/page.tsx index f0a7ef3..0195857 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -86,12 +86,12 @@ export default function AuthPage() { }; const inputClass = (hasError: boolean) => - `w-full bg-[#0d1210] border px-4 py-3 text-sm font-mono text-white placeholder-[#2a3a2a] outline-none rounded-sm transition-all duration-200 ${ - hasError ? "border-red-500/50" : "border-[#1a2a1a] focus:border-[#4aff8c]/40" + `w-full bg-wy-surface border px-4 py-3 text-sm font-mono text-wy-text-primary placeholder-wy-text-secondary outline-none rounded-md transition-all duration-200 ${ + hasError ? "border-red-500/60" : "border-wy-border focus:border-acid-green/60" }`; return ( -
+
-
+
{/* Header */}
-
+
Analytics Dashboard
-

+

WYVIEW

{/* Tabs */} -
+
@@ -210,19 +210,19 @@ export default function AuthPage() {

— {regError}

)} {regSuccess && ( -

✓ {regSuccess}

+

✓ {regSuccess}

)} )} -
+
WYVIEW v1.0 /// CROWMATE
diff --git a/app/tiktok/layout.tsx b/app/tiktok/layout.tsx index 3383095..fe65f98 100644 --- a/app/tiktok/layout.tsx +++ b/app/tiktok/layout.tsx @@ -19,9 +19,9 @@ export default function AuthLayout({ children }: { children: React.ReactNode }) if (status !== "authenticated") return null; return ( -
+
-
+
{children}
diff --git a/app/tiktok/page.tsx b/app/tiktok/page.tsx index 9f013f9..4f79965 100644 --- a/app/tiktok/page.tsx +++ b/app/tiktok/page.tsx @@ -69,7 +69,7 @@ export default function TikTokPage() {
-
Plateforme
+
Plateforme

TikTok

@@ -99,8 +99,8 @@ export default function TikTokPage() { {/* Chargement */} {loading && ( -
- +
+ Chargement...
)} @@ -109,12 +109,12 @@ export default function TikTokPage() { {!loading && stats && ( <> {stats.displayName && ( -
+
{stats.avatarUrl && ( - avatar + avatar )} - {stats.displayName} - Connecté + {stats.displayName} + Connecté
)} @@ -149,14 +149,14 @@ export default function TikTokPage() { {/* Non connecté */} {!loading && !stats && !error && ( -
- -

+

+ +

Connectez votre compte TikTok
pour afficher vos statistiques

Connecter TikTok @@ -166,10 +166,10 @@ export default function TikTokPage() { {/* Erreur API */} {!loading && error && ( -
- -

{error}

-
diff --git a/app/twitch/layout.tsx b/app/twitch/layout.tsx index 3383095..fe65f98 100644 --- a/app/twitch/layout.tsx +++ b/app/twitch/layout.tsx @@ -19,9 +19,9 @@ export default function AuthLayout({ children }: { children: React.ReactNode }) if (status !== "authenticated") return null; return ( -
+
-
+
{children}
diff --git a/app/twitch/page.tsx b/app/twitch/page.tsx index f826bec..79c31ca 100644 --- a/app/twitch/page.tsx +++ b/app/twitch/page.tsx @@ -5,11 +5,11 @@ export default function TwitchPage() { return (
-
+
-
Plateforme
+
Plateforme

Twitch

@@ -21,9 +21,9 @@ export default function TwitchPage() {
-
- -

+

+ +

CONNECTEZ VOTRE COMPTE TWITCH
POUR AFFICHER VOS STATISTIQUES

diff --git a/app/youtube/layout.tsx b/app/youtube/layout.tsx index 3383095..fe65f98 100644 --- a/app/youtube/layout.tsx +++ b/app/youtube/layout.tsx @@ -19,9 +19,9 @@ export default function AuthLayout({ children }: { children: React.ReactNode }) if (status !== "authenticated") return null; return ( -
+
-
+
{children}
diff --git a/app/youtube/page.tsx b/app/youtube/page.tsx index e4d7f8d..6e39acd 100644 --- a/app/youtube/page.tsx +++ b/app/youtube/page.tsx @@ -5,11 +5,11 @@ export default function YoutubePage() { return (
-
+
-
Plateforme
+
Plateforme

YouTube

@@ -21,9 +21,9 @@ export default function YoutubePage() {
-
- -

+

+ +

CONNECTEZ VOTRE COMPTE YOUTUBE
POUR AFFICHER VOS STATISTIQUES

diff --git a/components/LiveBanner.tsx b/components/LiveBanner.tsx index 071779c..b96c21a 100644 --- a/components/LiveBanner.tsx +++ b/components/LiveBanner.tsx @@ -8,40 +8,40 @@ export type StreamInfo = { export default function LiveBanner({ stream }: { stream: StreamInfo }) { return ( -
{stream.live ? ( - + EN DIRECT ) : ( - + HORS LIGNE )} {stream.duration && ( - {stream.duration} + {stream.duration} )}
{stream.title || "En attente du prochain stream..."}
{stream.game && ( -
🎮 {stream.game}
+
🎮 {stream.game}
)}
-
+
{stream.viewers ?? 0}
-
VIEWERS
+
VIEWERS
); diff --git a/components/LogFeed.tsx b/components/LogFeed.tsx index e837524..b2c1f68 100644 --- a/components/LogFeed.tsx +++ b/components/LogFeed.tsx @@ -7,12 +7,12 @@ export type LogEntry = { }; const typeStyles = { - info: { border: "border-l-[#4aff8c]/60", icon: "✅" }, + info: { border: "border-l-acid-green/60", icon: "✅" }, warn: { border: "border-l-yellow-400/60", icon: "⚠️" }, ban: { border: "border-l-red-500/60", icon: "🔨" }, unban: { border: "border-l-blue-400/60", icon: "🔓" }, twitch: { border: "border-l-purple-400/60", icon: "📡" }, - sub: { border: "border-l-[#4aff8c]/60", icon: "🎖️" }, + sub: { border: "border-l-acid-green/60", icon: "🎖️" }, }; const MOCK_LOGS: LogEntry[] = [ @@ -32,17 +32,17 @@ export default function LogFeed({ logs = MOCK_LOGS }: { logs?: LogEntry[] }) { return (
{style.icon}
-
{log.text}
+
{log.text}
{log.reason && ( -
{log.reason}
+
{log.reason}
)}
-
{log.time}
+
{log.time}
); })} diff --git a/components/MemberList.tsx b/components/MemberList.tsx index b1076ee..22e3217 100644 --- a/components/MemberList.tsx +++ b/components/MemberList.tsx @@ -6,10 +6,10 @@ export type Member = { }; const roleStyles = { - admin: { label: "ADMIN", cls: "text-red-400 bg-red-500/8 border-red-500/20" }, - mod: { label: "MOD", cls: "text-yellow-400 bg-yellow-400/8 border-yellow-400/20" }, - sub: { label: "SUB", cls: "text-[#4aff8c] bg-[#4aff8c]/8 border-[#4aff8c]/20" }, - viewer: { label: "VIEWER", cls: "text-blue-400 bg-blue-400/8 border-blue-400/20" }, + admin: { label: "ADMIN", cls: "text-red-400 bg-red-500/10 border-red-500/30" }, + mod: { label: "MOD", cls: "text-yellow-400 bg-yellow-400/10 border-yellow-400/30" }, + sub: { label: "SUB", cls: "text-acid-green bg-acid-green/10 border-acid-green/30" }, + viewer: { label: "VIEWER", cls: "text-blue-400 bg-blue-400/10 border-blue-400/30" }, }; const AVATARS = ["🗡️", "🛡️", "🏹", "⚔️", "🔥", "💀", "🐉", "⚡"]; @@ -32,13 +32,13 @@ export default function MemberList({ members = MOCK_MEMBERS }: { members?: Membe return (
-
+
{avatar}
-
{m.name}
- +
{m.name}
+ {role.label}
diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 62190eb..aad510b 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -31,18 +31,17 @@ export default function Sidebar() { }; return ( -