From a891d264b9436d430467c75df64d08fb89eda50e Mon Sep 17 00:00:00 2001 From: Leo dev Date: Mon, 2 Feb 2026 20:35:56 +0100 Subject: [PATCH 01/28] Locked the cursor in place --- src/app/run/page.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/run/page.tsx b/src/app/run/page.tsx index 7ed19bf..0cada5a 100644 --- a/src/app/run/page.tsx +++ b/src/app/run/page.tsx @@ -1,7 +1,11 @@ "use client"; import { FileTree } from "@sinm/react-file-tree"; -import CodeMirror, { ReactCodeMirrorRef } from "@uiw/react-codemirror"; +import CodeMirror, { + EditorState, + EditorView, + ReactCodeMirrorRef, +} from "@uiw/react-codemirror"; import { vscodeDark } from "@uiw/codemirror-theme-vscode"; import { useEffect, useRef } from "react"; @@ -99,7 +103,14 @@ export default function Run() { readOnly className="w-full h-full" value="yo" - extensions={[]} + extensions={[ + EditorState.transactionFilter.of((tr) => { + if (tr.selection && tr.isUserEvent("select")) { + return []; + } + return tr; + }), + ]} theme={vscodeDark} onCreateEditor={(view) => { view.focus(); From 0493733afebd7ea19d73f3d376435f1f58af614e Mon Sep 17 00:00:00 2001 From: Leo dev Date: Mon, 2 Feb 2026 20:55:20 +0100 Subject: [PATCH 02/28] Removed profile from nav --- src/components/app/Navbar.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/app/Navbar.tsx b/src/components/app/Navbar.tsx index 5906f8c..62a3d63 100644 --- a/src/components/app/Navbar.tsx +++ b/src/components/app/Navbar.tsx @@ -1,7 +1,7 @@ "use client"; import Link from "next/link"; -import { Timer, Trophy, User, Zap } from "lucide-react"; +import { Radio, Trophy, Zap } from "lucide-react"; import { usePathname } from "next/navigation"; import { cn } from "@/lib/utils"; @@ -18,14 +18,9 @@ const navs = [ }, { link: "/runs", - icon: Timer, + icon: Radio, name: "Runs", }, - { - link: "/profile", - icon: User, - name: "Profile", - }, ]; const Navbar = () => { From b0e481134f5d73a4b01d5f62e18164b53d247f5b Mon Sep 17 00:00:00 2001 From: Leo dev Date: Mon, 2 Feb 2026 23:08:14 +0100 Subject: [PATCH 03/28] Shadcnified leaderboards --- package-lock.json | 406 ++++++++++++++++++++++++ package.json | 1 + src/app/leaderboards/page.tsx | 522 +++++++++++++++---------------- src/components/ui/badge.tsx | 48 +++ src/components/ui/card.tsx | 92 ++++++ src/components/ui/pagination.tsx | 127 ++++++++ src/components/ui/table.tsx | 116 +++++++ src/components/ui/tabs.tsx | 91 ++++++ 8 files changed, 1137 insertions(+), 266 deletions(-) create mode 100644 src/components/ui/badge.tsx create mode 100644 src/components/ui/card.tsx create mode 100644 src/components/ui/pagination.tsx create mode 100644 src/components/ui/table.tsx create mode 100644 src/components/ui/tabs.tsx diff --git a/package-lock.json b/package-lock.json index 2416fec..08d0f02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,6 +45,7 @@ "embla-carousel-react": "^8.6.0", "lucide-react": "^0.563.0", "next": "16.1.6", + "radix-ui": "^1.4.3", "react": "19.2.3", "react-day-picker": "^9.13.0", "react-dom": "19.2.3", @@ -923,6 +924,29 @@ "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==", "license": "MIT" }, + "node_modules/@radix-ui/react-accessible-icon": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.1.7.tgz", + "integrity": "sha512-XM+E4WXl0OqUJFovy6GjmxxFyx9opfCAIUku4dlKRd5YEPqt4kALOkQOp0Of6reHuUkJuiPBEc5k0o4z4lTC8A==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-visually-hidden": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-accordion": { "version": "1.2.12", "resolved": "https://registry.npmjs.org/@radix-ui/react-accordion/-/react-accordion-1.2.12.tgz", @@ -1461,6 +1485,57 @@ } } }, + "node_modules/@radix-ui/react-form": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@radix-ui/react-form/-/react-form-0.1.8.tgz", + "integrity": "sha512-QM70k4Zwjttifr5a4sZFts9fn8FzHYvQ5PiB19O2HsYibaHSVt9fH9rzB0XZo/YcM+b7t/p7lYCT/F5eOeF5yQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-label": "2.1.7", + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-form/node_modules/@radix-ui/react-label": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.7.tgz", + "integrity": "sha512-YT1GqPSL8kJn20djelMX7/cTRp/Y9w5IZHvfxQTVHrOqa2yMl7i/UfMqKRU5V7mEyKTrUVgJXhNQPVCG8PBLoQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-hover-card": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/@radix-ui/react-hover-card/-/react-hover-card-1.1.15.tgz", @@ -1682,6 +1757,70 @@ } } }, + "node_modules/@radix-ui/react-one-time-password-field": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@radix-ui/react-one-time-password-field/-/react-one-time-password-field-0.1.8.tgz", + "integrity": "sha512-ycS4rbwURavDPVjCb5iS3aG4lURFDILi6sKI/WITUMZ13gMmn/xGjpLoqBAalhJaDk8I3UbCM5GzKHrnzwHbvg==", + "license": "MIT", + "dependencies": { + "@radix-ui/number": "1.1.1", + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-collection": "1.1.7", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-roving-focus": "1.1.11", + "@radix-ui/react-use-controllable-state": "1.2.2", + "@radix-ui/react-use-effect-event": "0.0.2", + "@radix-ui/react-use-is-hydrated": "0.1.0", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-password-toggle-field": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-password-toggle-field/-/react-password-toggle-field-0.1.3.tgz", + "integrity": "sha512-/UuCrDBWravcaMix4TdT+qlNdVwOM1Nck9kWx/vafXsdfj1ChfhOdfi3cy9SGBpWgTXwYCuboT/oYpJy3clqfw==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-controllable-state": "1.2.2", + "@radix-ui/react-use-effect-event": "0.0.2", + "@radix-ui/react-use-is-hydrated": "0.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-popover": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.15.tgz", @@ -2319,6 +2458,58 @@ } } }, + "node_modules/@radix-ui/react-toolbar": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@radix-ui/react-toolbar/-/react-toolbar-1.1.11.tgz", + "integrity": "sha512-4ol06/1bLoFu1nwUqzdD4Y5RZ9oDdKeiHIsntug54Hcr1pgaHiPqHFEaXI1IFP/EsOfROQZ8Mig9VTIRza6Tjg==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-roving-focus": "1.1.11", + "@radix-ui/react-separator": "1.1.7", + "@radix-ui/react-toggle-group": "1.1.11" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-toolbar/node_modules/@radix-ui/react-separator": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.7.tgz", + "integrity": "sha512-0HEb8R9E8A+jZjvmFCy/J4xhbXy3TV+9XSnGJ3KvTtjlIUy/YQ/p6UYZvi7YbeoeXdyU9+Y3scizK6hkY37baA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-tooltip": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.2.8.tgz", @@ -3872,6 +4063,221 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "license": "MIT" }, + "node_modules/radix-ui": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/radix-ui/-/radix-ui-1.4.3.tgz", + "integrity": "sha512-aWizCQiyeAenIdUbqEpXgRA1ya65P13NKn/W8rWkcN0OPkRDxdBVLWnIEDsS2RpwCK2nobI7oMUSmexzTDyAmA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-accessible-icon": "1.1.7", + "@radix-ui/react-accordion": "1.2.12", + "@radix-ui/react-alert-dialog": "1.1.15", + "@radix-ui/react-arrow": "1.1.7", + "@radix-ui/react-aspect-ratio": "1.1.7", + "@radix-ui/react-avatar": "1.1.10", + "@radix-ui/react-checkbox": "1.3.3", + "@radix-ui/react-collapsible": "1.1.12", + "@radix-ui/react-collection": "1.1.7", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-context-menu": "2.2.16", + "@radix-ui/react-dialog": "1.1.15", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-dismissable-layer": "1.1.11", + "@radix-ui/react-dropdown-menu": "2.1.16", + "@radix-ui/react-focus-guards": "1.1.3", + "@radix-ui/react-focus-scope": "1.1.7", + "@radix-ui/react-form": "0.1.8", + "@radix-ui/react-hover-card": "1.1.15", + "@radix-ui/react-label": "2.1.7", + "@radix-ui/react-menu": "2.1.16", + "@radix-ui/react-menubar": "1.1.16", + "@radix-ui/react-navigation-menu": "1.2.14", + "@radix-ui/react-one-time-password-field": "0.1.8", + "@radix-ui/react-password-toggle-field": "0.1.3", + "@radix-ui/react-popover": "1.1.15", + "@radix-ui/react-popper": "1.2.8", + "@radix-ui/react-portal": "1.1.9", + "@radix-ui/react-presence": "1.1.5", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-progress": "1.1.7", + "@radix-ui/react-radio-group": "1.3.8", + "@radix-ui/react-roving-focus": "1.1.11", + "@radix-ui/react-scroll-area": "1.2.10", + "@radix-ui/react-select": "2.2.6", + "@radix-ui/react-separator": "1.1.7", + "@radix-ui/react-slider": "1.3.6", + "@radix-ui/react-slot": "1.2.3", + "@radix-ui/react-switch": "1.2.6", + "@radix-ui/react-tabs": "1.1.13", + "@radix-ui/react-toast": "1.2.15", + "@radix-ui/react-toggle": "1.1.10", + "@radix-ui/react-toggle-group": "1.1.11", + "@radix-ui/react-toolbar": "1.1.11", + "@radix-ui/react-tooltip": "1.2.8", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-controllable-state": "1.2.2", + "@radix-ui/react-use-effect-event": "0.0.2", + "@radix-ui/react-use-escape-keydown": "1.1.1", + "@radix-ui/react-use-is-hydrated": "0.1.0", + "@radix-ui/react-use-layout-effect": "1.1.1", + "@radix-ui/react-use-size": "1.1.1", + "@radix-ui/react-visually-hidden": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/radix-ui/node_modules/@radix-ui/react-aspect-ratio": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.1.7.tgz", + "integrity": "sha512-Yq6lvO9HQyPwev1onK1daHCHqXVLzPhSVjmsNjCa2Zcxy2f7uJD2itDtxknv6FzAKCwD1qQkeVDmX/cev13n/g==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/radix-ui/node_modules/@radix-ui/react-avatar": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.1.10.tgz", + "integrity": "sha512-V8piFfWapM5OmNCXTzVQY+E1rDa53zY+MQ4Y7356v4fFz6vqCyUtIz2rUD44ZEdwg78/jKmMJHj07+C/Z/rcog==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-is-hydrated": "0.1.0", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/radix-ui/node_modules/@radix-ui/react-label": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.7.tgz", + "integrity": "sha512-YT1GqPSL8kJn20djelMX7/cTRp/Y9w5IZHvfxQTVHrOqa2yMl7i/UfMqKRU5V7mEyKTrUVgJXhNQPVCG8PBLoQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/radix-ui/node_modules/@radix-ui/react-progress": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.1.7.tgz", + "integrity": "sha512-vPdg/tF6YC/ynuBIJlk1mm7Le0VgW6ub6J2UWnTQ7/D23KXcPI1qy+0vBkgKgd38RCMJavBXpB83HPNFMTb0Fg==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/radix-ui/node_modules/@radix-ui/react-separator": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.7.tgz", + "integrity": "sha512-0HEb8R9E8A+jZjvmFCy/J4xhbXy3TV+9XSnGJ3KvTtjlIUy/YQ/p6UYZvi7YbeoeXdyU9+Y3scizK6hkY37baA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/radix-ui/node_modules/@radix-ui/react-slot": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz", + "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/react": { "version": "19.2.3", "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", diff --git a/package.json b/package.json index 924bf88..cc7a044 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "embla-carousel-react": "^8.6.0", "lucide-react": "^0.563.0", "next": "16.1.6", + "radix-ui": "^1.4.3", "react": "19.2.3", "react-day-picker": "^9.13.0", "react-dom": "19.2.3", diff --git a/src/app/leaderboards/page.tsx b/src/app/leaderboards/page.tsx index 93974f9..6101ae8 100644 --- a/src/app/leaderboards/page.tsx +++ b/src/app/leaderboards/page.tsx @@ -1,305 +1,295 @@ "use client"; import { Trophy, Calendar, Globe, TrendingUp } from "lucide-react"; -import LeaderboardRow from "@/components/app/LeaderboardRow"; import { useState } from "react"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { + Table, + TableBody, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import { Badge } from "@/components/ui/badge"; +import { + Pagination, + PaginationContent, + PaginationItem, + PaginationLink, + PaginationNext, + PaginationPrevious, +} from "@/components/ui/pagination"; + +import LeaderboardRow from "@/components/app/LeaderboardRow"; + +const globalLeaderboard = [ + { + rank: 1, + username: "speedmaster_x", + pb: "2:34.21", + runsCount: 2341, + category: "Any%", + }, + { + rank: 2, + username: "algo_ninja", + pb: "2:38.54", + runsCount: 1876, + category: "Any%", + }, + { + rank: 3, + username: "clockwork", + pb: "2:41.02", + runsCount: 3102, + category: "Any%", + }, + { + rank: 4, + username: "fastfingers99", + pb: "2:45.33", + runsCount: 987, + category: "Any%", + }, + { + rank: 5, + username: "recursion_queen", + pb: "2:47.89", + runsCount: 1543, + category: "Any%", + }, + { + rank: 6, + username: "bitshifter", + pb: "2:52.11", + runsCount: 2109, + category: "Any%", + }, + { + rank: 7, + username: "nullpointer", + pb: "2:54.67", + runsCount: 876, + category: "Any%", + }, + { + rank: 8, + username: "stackattack", + pb: "2:58.23", + runsCount: 1234, + category: "Any%", + }, + { + rank: 9, + username: "looplegend", + pb: "3:01.45", + runsCount: 654, + category: "Any%", + }, + { + rank: 10, + username: "coderunner", + pb: "3:05.78", + runsCount: 1098, + category: "Any%", + }, +]; +const weeklyLeaderboard = [ + { + rank: 1, + username: "weekly_warrior", + pb: "2:51.33", + runsCount: 156, + category: "Any%", + }, + { + rank: 2, + username: "speedmaster_x", + pb: "2:53.12", + runsCount: 89, + category: "Any%", + }, + { + rank: 3, + username: "newbie_grinder", + pb: "2:58.67", + runsCount: 234, + category: "Any%", + }, + { + rank: 4, + username: "algo_ninja", + pb: "3:02.45", + runsCount: 67, + category: "Any%", + }, + { + rank: 5, + username: "fresh_runner", + pb: "3:05.89", + runsCount: 45, + category: "Any%", + }, + { + rank: 6, + username: "practice_makes", + pb: "3:08.12", + runsCount: 112, + category: "Any%", + }, + { + rank: 7, + username: "splitmaster", + pb: "3:12.34", + runsCount: 78, + category: "Any%", + }, + { + rank: 8, + username: "grindtime", + pb: "3:15.56", + runsCount: 92, + category: "Any%", + }, + { + rank: 9, + username: "pb_hunter", + pb: "3:18.90", + runsCount: 56, + category: "Any%", + }, + { + rank: 10, + username: "reset_king", + pb: "3:22.11", + runsCount: 187, + category: "Any%", + }, +]; + const Leaderboards = () => { const [activeTab, setActiveTab] = useState<"global" | "weekly">("global"); - const globalLeaderboard = [ - { - rank: 1, - username: "speedmaster_x", - pb: "2:34.21", - runsCount: 2341, - category: "Any%", - }, - { - rank: 2, - username: "algo_ninja", - pb: "2:38.54", - runsCount: 1876, - category: "Any%", - }, - { - rank: 3, - username: "clockwork", - pb: "2:41.02", - runsCount: 3102, - category: "Any%", - }, - { - rank: 4, - username: "fastfingers99", - pb: "2:45.33", - runsCount: 987, - category: "Any%", - }, - { - rank: 5, - username: "recursion_queen", - pb: "2:47.89", - runsCount: 1543, - category: "Any%", - }, - { - rank: 6, - username: "bitshifter", - pb: "2:52.11", - runsCount: 2109, - category: "Any%", - }, - { - rank: 7, - username: "nullpointer", - pb: "2:54.67", - runsCount: 876, - category: "Any%", - }, - { - rank: 8, - username: "stackattack", - pb: "2:58.23", - runsCount: 1234, - category: "Any%", - }, - { - rank: 9, - username: "looplegend", - pb: "3:01.45", - runsCount: 654, - category: "Any%", - }, - { - rank: 10, - username: "coderunner", - pb: "3:05.78", - runsCount: 1098, - category: "Any%", - }, - ]; - - const weeklyLeaderboard = [ - { - rank: 1, - username: "weekly_warrior", - pb: "2:51.33", - runsCount: 156, - category: "Any%", - }, - { - rank: 2, - username: "speedmaster_x", - pb: "2:53.12", - runsCount: 89, - category: "Any%", - }, - { - rank: 3, - username: "newbie_grinder", - pb: "2:58.67", - runsCount: 234, - category: "Any%", - }, - { - rank: 4, - username: "algo_ninja", - pb: "3:02.45", - runsCount: 67, - category: "Any%", - }, - { - rank: 5, - username: "fresh_runner", - pb: "3:05.89", - runsCount: 45, - category: "Any%", - }, - { - rank: 6, - username: "practice_makes", - pb: "3:08.12", - runsCount: 112, - category: "Any%", - }, - { - rank: 7, - username: "splitmaster", - pb: "3:12.34", - runsCount: 78, - category: "Any%", - }, - { - rank: 8, - username: "grindtime", - pb: "3:15.56", - runsCount: 92, - category: "Any%", - }, - { - rank: 9, - username: "pb_hunter", - pb: "3:18.90", - runsCount: 56, - category: "Any%", - }, - { - rank: 10, - username: "reset_king", - pb: "3:22.11", - runsCount: 187, - category: "Any%", - }, - ]; - const categories = ["Any%", "100%", "Easy Only", "No DP", "Blind"]; + const data = activeTab === "global" ? globalLeaderboard : weeklyLeaderboard; + return (
-
+
{/* Header */} -
-

- Leaderboards -

+
+

Leaderboards

The fastest runners in the game. Will you claim a spot?

- {/* Stats Row */} -
-
- -

- 12,453 -

-

Total Runners

-
-
- -

- 2:34.21 -

-

World Record

-
-
- -

847K

-

Runs This Week

-
-
- -

- 5d 12h -

-

Until Reset

-
+ {/* Stats */} +
+ + + +
- {/* Tabs and Filters */} -
- {/* Global/Weekly Toggle */} -
- - -
+ {/* Tabs + Filters */} +
+ setActiveTab(v as "global" | "weekly")} + > + + + + Global + + + + Weekly + + + - {/* Category Filter */} -
+
{categories.map((cat, i) => ( - + ))}
- {/* Leaderboard Table */} -
- - - - - - - - - - - - {(activeTab === "global" - ? globalLeaderboard - : weeklyLeaderboard - ).map((entry, i) => ( + {/* Table */} + +
- Rank - - Runner - - PB - - Runs - - Category -
+ + + Rank + Runner + PB + Runs + Category + + + + {data.map((entry, i) => ( ))} - -
-
+ + + {/* Pagination */} -
- - {[1, 2, 3, 50].map((page, i) => ( - - ))} - -
+ + + + + + + {[1, 2, 3, 50].map((p) => ( + + {p} + + ))} + + + + + +
); }; export default Leaderboards; + +/* ---------- helpers ---------- */ + +function StatCard({ + icon: Icon, + label, + value, +}: { + icon: any; + label: string; + value: string; +}) { + return ( + + + + {value} +

{label}

+
+
+ ); +} diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx new file mode 100644 index 0000000..beb56ed --- /dev/null +++ b/src/components/ui/badge.tsx @@ -0,0 +1,48 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" +import { Slot } from "radix-ui" + +import { cn } from "@/lib/utils" + +const badgeVariants = cva( + "inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", + { + variants: { + variant: { + default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90", + secondary: + "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90", + destructive: + "bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", + outline: + "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground", + ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground", + link: "text-primary underline-offset-4 [a&]:hover:underline", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +function Badge({ + className, + variant = "default", + asChild = false, + ...props +}: React.ComponentProps<"span"> & + VariantProps & { asChild?: boolean }) { + const Comp = asChild ? Slot.Root : "span" + + return ( + + ) +} + +export { Badge, badgeVariants } diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx new file mode 100644 index 0000000..681ad98 --- /dev/null +++ b/src/components/ui/card.tsx @@ -0,0 +1,92 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +function Card({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardHeader({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardTitle({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardDescription({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardAction({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardContent({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardFooter({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +export { + Card, + CardHeader, + CardFooter, + CardTitle, + CardAction, + CardDescription, + CardContent, +} diff --git a/src/components/ui/pagination.tsx b/src/components/ui/pagination.tsx new file mode 100644 index 0000000..1dcfb0c --- /dev/null +++ b/src/components/ui/pagination.tsx @@ -0,0 +1,127 @@ +import * as React from "react" +import { + ChevronLeftIcon, + ChevronRightIcon, + MoreHorizontalIcon, +} from "lucide-react" + +import { cn } from "@/lib/utils" +import { buttonVariants, type Button } from "@/components/ui/button" + +function Pagination({ className, ...props }: React.ComponentProps<"nav">) { + return ( +