From 4647e9df60ed48eff3d1b012c66a9d60f3f5f299 Mon Sep 17 00:00:00 2001 From: Taken Date: Sat, 27 Sep 2025 21:53:09 +0200 Subject: [PATCH] Finished guild sidebar --- .../guild/[value]/_components/sidebar.tsx | 34 +++++++++++++++++++ src/lib/schema/guild.ts | 8 ++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/app/(stats)/guild/[value]/_components/sidebar.tsx b/src/app/(stats)/guild/[value]/_components/sidebar.tsx index d1354bc..a5b3758 100644 --- a/src/app/(stats)/guild/[value]/_components/sidebar.tsx +++ b/src/app/(stats)/guild/[value]/_components/sidebar.tsx @@ -78,6 +78,36 @@ export default function Sidebar({ guild }: SidebarProps) { ) } + function Achievements() { + return ( +
+

Achievements

+ + + +
+ ) + } + + function GameExperience() { + return ( +
+

Experience

+ {guild.guildExpByGameType === undefined ?

No EXP in any games

: ( +
+ {Object.entries(guild.guildExpByGameType).map(g => { + const game = getGame(g[0]) + if (!game) return null + return { name: game.name, val: g[1] } + }).filter(g => g !== null).sort().map((v, i) => { + return + })} +
+ )} +
+ ) + } + return ( @@ -98,6 +128,10 @@ export default function Sidebar({ guild }: SidebarProps) { + + + + ) diff --git a/src/lib/schema/guild.ts b/src/lib/schema/guild.ts index 81d03dc..7f899a1 100644 --- a/src/lib/schema/guild.ts +++ b/src/lib/schema/guild.ts @@ -26,7 +26,13 @@ export const guildSchema = z.object({ description: z.string().optional(), joinable: z.boolean().default(false), publiclyListed: z.boolean().default(false), - preferredGames: z.array(z.string()).optional() + preferredGames: z.array(z.string()).optional(), + achievements: z.object({ + WINNERS: z.number().default(0), + EXPERIENCE_KINGS: z.number().default(0), + ONLINE_PLAYERS: z.number().default(0) + }), + guildExpByGameType: z.record(z.string(), z.number()).optional() }) })