From 71b966088b10beb121d32a8a31667f76bf72fcbc Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sat, 7 Feb 2026 01:31:47 +0100 Subject: [PATCH] Improved run layout --- src/app/problems/components/ProblemCard.tsx | 48 ++++++++++++--------- src/app/run/page.tsx | 13 +++--- src/components/app/ProfileCard.tsx | 37 ++++++++++++++++ 3 files changed, 71 insertions(+), 27 deletions(-) create mode 100644 src/components/app/ProfileCard.tsx diff --git a/src/app/problems/components/ProblemCard.tsx b/src/app/problems/components/ProblemCard.tsx index bd881e4..1e7f9b6 100644 --- a/src/app/problems/components/ProblemCard.tsx +++ b/src/app/problems/components/ProblemCard.tsx @@ -32,16 +32,17 @@ const ProblemCard = ({ return (
{/* Glow effect on hover */} -
+
-
+ {/* Content */} +
{/* Header */}

@@ -66,25 +67,30 @@ const ProblemCard = ({ ))}

- {/* Stats */} -
- {bestTime && ( -
- - {bestTime} -
- )} -
- - {attempts} runs -
-
+ {/* Spacer */} +
- {/* Quick run button - appears on hover */} -
- + {/* Stats + Action */} +
+
+ {bestTime && ( +
+ + {bestTime} +
+ )} +
+ + {attempts} runs +
+
+ + {/* Quick run button */} +
+ +
diff --git a/src/app/run/page.tsx b/src/app/run/page.tsx index 4b150d8..ee44840 100644 --- a/src/app/run/page.tsx +++ b/src/app/run/page.tsx @@ -9,6 +9,7 @@ import Editor from "./components/Editor"; import useAction from "@/hook/use-action"; import { getLiveRun } from "@/modules/live-run/actions"; import ProblemCard from "../problems/components/ProblemCard"; +import ProfileCard from "@/components/app/ProfileCard"; export default function Run() { const [runInfo] = useAction(getLiveRun); @@ -23,17 +24,17 @@ export default function Run() {
-
- +
+ +
+ +
+ {runInfo && }
- -
- {runInfo && } -
{/* Editor */} diff --git a/src/components/app/ProfileCard.tsx b/src/components/app/ProfileCard.tsx new file mode 100644 index 0000000..b6e878a --- /dev/null +++ b/src/components/app/ProfileCard.tsx @@ -0,0 +1,37 @@ +import { Badge } from "../ui/badge"; +import { Card, CardContent } from "../ui/card"; + +export default function ProfileCard({ + user, +}: { + user: { username: string; rank: number }; +}) { + return ( + +
+ + + {/* Avatar */} +
+ Img + +
+ #{user.rank} +
+
+ + {/* User Info */} +
+

+ {user.username} +

+ World Record Holder +
+
+ + ); +}