From dd136984225530c6bf58683332d1e79788014556 Mon Sep 17 00:00:00 2001 From: Christian Fehmer Date: Sun, 1 Feb 2026 00:58:41 +0100 Subject: [PATCH 01/26] refactor: solid leaderboards (@fehmer) --- frontend/src/ts/components/common/Button.tsx | 6 +- frontend/src/ts/components/mount.tsx | 4 +- .../pages/leaderboard/LeaderboardPage.tsx | 28 ++++ .../components/pages/leaderboard/Sidebar.tsx | 142 ++++++++++++++++++ 4 files changed, 176 insertions(+), 4 deletions(-) create mode 100644 frontend/src/ts/components/pages/leaderboard/LeaderboardPage.tsx create mode 100644 frontend/src/ts/components/pages/leaderboard/Sidebar.tsx diff --git a/frontend/src/ts/components/common/Button.tsx b/frontend/src/ts/components/common/Button.tsx index acd421c94a66..729436e3a375 100644 --- a/frontend/src/ts/components/common/Button.tsx +++ b/frontend/src/ts/components/common/Button.tsx @@ -1,4 +1,4 @@ -import { JSXElement, Show } from "solid-js"; +import { JSX, JSXElement, Show } from "solid-js"; import { Conditional } from "./Conditional"; import { Fa, FaProps } from "./Fa"; @@ -7,6 +7,7 @@ type BaseProps = { text?: string; fa?: FaProps; class?: string; + classList?: JSX.HTMLAttributes["classList"]; type?: "text" | "button"; children?: JSXElement; }; @@ -36,10 +37,11 @@ export function Button(props: ButtonProps | AnchorProps): JSXElement { ); - const getClassList = (): Record => { + const getClassList = (): Record => { return { [(props.type ?? "button") === "text" ? "textButton" : buttonClass]: true, [props.class ?? ""]: props.class !== undefined, + ...props.classList, }; }; diff --git a/frontend/src/ts/components/mount.tsx b/frontend/src/ts/components/mount.tsx index a4dae541c9c4..e0976c33ed03 100644 --- a/frontend/src/ts/components/mount.tsx +++ b/frontend/src/ts/components/mount.tsx @@ -10,11 +10,11 @@ import { Theme } from "./core/Theme"; import { Footer } from "./layout/footer/Footer"; import { Overlays } from "./layout/overlays/Overlays"; import { Modals } from "./modals/Modals"; -import { AboutPage } from "./pages/AboutPage"; +import { LeaderboardPage } from "./pages/leaderboard/LeaderboardPage"; const components: Record JSXElement> = { footer: () =>